Enum TxnType

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

    public enum TxnType
    extends java.lang.Enum<TxnType>
    • Enum Constant Detail

      • READ

        public static final TxnType READ
        Transaction mode:
        • WRITE: this guarantees a WRITE will complete if commit() is called. The same as begin(ReadWrite.WRITE).
        • READ: the transaction can not promote to WRITE,ensuring read-only access to the data. The same as begin(ReadWrite.READ).
        • READ_PROMOTE: the transaction will go from "read" to "write" if the dataset has not been modified but if it has, the promotion fails with exception.
        • READ_COMMITTED_PROMOTE: Use this with care. The promotion will succeed but changes from other transactions become visible.
        Read committed: at the point transaction attempts promotion from "read" to "write", the system checks if the dataset has changed since the transaction started (called begin). If READ_PROMOTE, the dataset must not have changed; if READ_COMMITTED_PROMOTE any intermediate changes are visible but the application can not assume any data it has read in the transaction is the same as it was at the point the transaction started.
      • WRITE

        public static final TxnType WRITE
      • READ_PROMOTE

        public static final TxnType READ_PROMOTE
      • READ_COMMITTED_PROMOTE

        public static final TxnType READ_COMMITTED_PROMOTE
    • Method Detail

      • values

        public static TxnType[] 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 (TxnType c : TxnType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TxnType 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
      • convert

        public static ReadWrite convert​(TxnType txnType)
        Convert a TxnType mode to ReadWrite : "promote" not supported.
      • initial

        public static ReadWrite initial​(TxnType txnType)
        Translate a TxnType to it's initial ReadWrite mode. WRITE -> WRITE, READ* -> READ regardless of promotion setting.