ImplicitTransactionManagementPolicy (Google App Engine API for Java)

com.google.appengine.api.datastore

Enum ImplicitTransactionManagementPolicy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ImplicitTransactionManagementPolicy>


    public enum ImplicitTransactionManagementPolicy
    extends java.lang.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 Summary

      Enum Constants 
      Enum Constant and Description
      AUTO
      If a current transaction exists, use it, otherwise create one.
      NONE
      If a current transaction exists, use it, otherwise execute without a transaction.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static ImplicitTransactionManagementPolicy valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ImplicitTransactionManagementPolicy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null