Enum Isolation

    • Enum Constant Detail

      • READ_COMMITTED

        public static final Isolation READ_COMMITTED
        Read Committed isolation.

        This is the default isolation level if no level is specified. This isolation level guarantees that only committed data is visible and doesn't provide any consistency guarantees. Reads are guaranteed to be monotonic. All writes acquire a write lock and reads do not acquire any lock. Any attempt to write to a locked entry will result in an exception; the request will not block. This is the weakest of the isolation levels and will generally be the most performant at the cost of read consistency.

      • STMT_CONSISTENT_READ

        public static final Isolation STMT_CONSISTENT_READ
        Statement Consistent Read isolation.

        Provides statement scoped read consistency. This isolation level guarantees that all the data read by a single operation comes from a single point in time; the time that the statement began execution. Reads are not guaranteed to be monotonic. All writes acquire a write lock and reads do not acquire any lock. Any attempt to write to a locked entry will result in an exception; the request will not block.

      • TX_CONSISTENT_READ

        public static final Isolation TX_CONSISTENT_READ
        Transaction Consistent Read isolation.

        Provides transaction scoped read consistency. This isolation level guarantees that all the data read in a transaction comes from a single point in time; the time that the transaction began. Reads are not guaranteed to be monotonic. All writes acquire a write lock and reads do not acquire any lock. Any attempt to write to a locked entry will result in an exception; the request will not block.

        Read operations with this isolation level may produce a VersionNotAvailableException if attempting to read a historical version of the data that is no longer available in storage.

      • STMT_MONOTONIC_CONSISTENT_READ

        public static final Isolation STMT_MONOTONIC_CONSISTENT_READ
        Statement Monotonic Consistent Read isolation.

        Provides statement scoped read consistency and monotonic reads. This isolation level guarantees that all data read by a single operation comes from a single point in time; the time that the statement began execution. Reads are guaranteed to be monotonic. This means that a read is guaranteed to return a version that is equal to or greater than any version that was previously encountered while using the connection. Due to the monotinic read guarantee, reads with this isolation may block until the necessary versions are available. All writes acquire a write lock and reads do not acquire any lock. Any attempt to write to a locked entry will result in an exception; the request will not block waiting for a write lock.

      • TX_MONOTONIC_CONSISTENT_READ

        public static final Isolation TX_MONOTONIC_CONSISTENT_READ
        Transaction Monotonic Consistent Read isolation.

        Provides transaction scoped read consistency and monotonic reads. This isolation level guarantees that all data read by a single operation comes from a single point in time; the time that the transaction began. Reads are guaranteed to be monotonic. This means that a read is guaranteed to return a version that is equal to or greater than any version that was previously encountered while using the connection. Due to the monotinic read guarantee, the initial read in a transaction with this isolation may block until the necessary versions are available. All writes acquire a write lock and reads do not acquire any lock. Any attempt to write to a locked entry will result in an exception; the request will not block waiting for a write lock.

        Read operations with this isolation level may produce a VersionNotAvailableException if attempting to read a historical version of the data that is no longer available in storage.

    • Method Detail

      • values

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

        public static Isolation 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
      • isConsistent

        public abstract boolean isConsistent()
        Returns whether the isolation level guaranteed consistent reads.
        Returns:
        true if consistent reads are guaranteed, false otherwise
      • isMonotonic

        public abstract boolean isMonotonic()
        Returns whether the isolation level guarantees monotonic reads.
        Returns:
        true if monotonic reads are guaranteed, false otherwise
      • toString

        public String toString()
        Return a human-readable description for this Isolation.
        Overrides:
        toString in class Enum<Isolation>
        Returns:
        a String description of the Isolation