Enum ImplicitTransactionManagementPolicy

  • All Implemented Interfaces:
    Serializable, Comparable<ImplicitTransactionManagementPolicy>

    public enum ImplicitTransactionManagementPolicy
    extends Enum<ImplicitTransactionManagementPolicy>
    Describes the various policies the datastore can follow for implicit transaction management. When deciding which policy to use, keep the following in mind: The datastore will automatically retry operations that fail due to concurrent updates to the same entity group if the operation is not part of a transaction. The datastore will not retry operations that fail due to concurrent updates to the same entity group if the operation is part of a transaction, and will instead immediately throw a ConcurrentModificationException. If your application needs to perform any sort of intelligent merging when concurrent attempts are made to update the same entity group you probably want AUTO, otherwise NONE is probably acceptable.

    See DatastoreService for a list of operations that perform implicit transaction management.

    • Enum Constant Detail

      • AUTO

        public static final ImplicitTransactionManagementPolicy AUTO
        If a current transaction exists, use it, otherwise create one. The transaction will be committed before the method returns if the datastore operation completes successfully and rolled back if the datastore operation does not complete successfully. No matter the type or quantity of entities provided, only one transaction will be created. This means that if you pass entities that belong to multiple entity groups into one of these methods and you have this policy enabled, you will receive an exception because transactions do not function across entity groups.
    • Method Detail

      • values

        public static ImplicitTransactionManagementPolicy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ImplicitTransactionManagementPolicy c : ImplicitTransactionManagementPolicy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ImplicitTransactionManagementPolicy valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null