Enum DdlInTransactionMode

java.lang.Object
java.lang.Enum<DdlInTransactionMode>
com.google.cloud.spanner.connection.DdlInTransactionMode
All Implemented Interfaces:
Serializable, Comparable<DdlInTransactionMode>

public enum DdlInTransactionMode extends Enum<DdlInTransactionMode>
Enum used for setting the behavior of DDL in read/write transactions.
  • Enum Constant Details

    • FAIL

      public static final DdlInTransactionMode FAIL
      All DDL statements in a read/write transaction fail.
    • ALLOW_IN_EMPTY_TRANSACTION

      public static final DdlInTransactionMode ALLOW_IN_EMPTY_TRANSACTION
      DDL statements in an empty transaction are allowed. That is; if the connection is in AutoCommit=false mode and no other statement has been executed, then executing a DDL statement or a DDL batch is allowed.
    • AUTO_COMMIT_TRANSACTION

      public static final DdlInTransactionMode AUTO_COMMIT_TRANSACTION
      DDL statements automatically cause the current transaction to be committed and the DDL statement is subsequently executed without a transaction. This is equal to how MySQL and Oracle behave.
  • Method Details

    • values

      public static DdlInTransactionMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DdlInTransactionMode 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