Enum Class TransactionIsolation

java.lang.Object
java.lang.Enum<TransactionIsolation>
org.tentackle.session.TransactionIsolation
All Implemented Interfaces:
Serializable, Comparable<TransactionIsolation>, Constable

public enum TransactionIsolation extends Enum<TransactionIsolation>
Enum that maps the low-level integer constants of the transaction isolation levels in java.sql.Connection.
  • Enum Constant Details

    • DEFAULT

      public static final TransactionIsolation DEFAULT
      Default transaction isolation.
      Usually READ_COMMITTED.
    • NONE

      public static final TransactionIsolation NONE
      Transactions are not supported at all.
    • READ_UNCOMMITTED

      public static final TransactionIsolation READ_UNCOMMITTED
      Dirty reads, non-repeatable reads and phantom reads can occur.
    • READ_COMMITTED

      public static final TransactionIsolation READ_COMMITTED
      Dirty reads are prevented, non-repeatable reads and phantom reads can occur.

      This is usually the default for most databases.

    • REPEATABLE_READ

      public static final TransactionIsolation REPEATABLE_READ
      Dirty reads and non-repeatable reads are prevented, phantom reads can occur.

      Applications running this isolation level should be prepared for temporary serialization errors and retry such transactions in a meaningful manner.

    • SERIALIZABLE

      public static final TransactionIsolation SERIALIZABLE
      Dirty reads, non-repeatable reads and phantom reads are prevented.

      Applications running this isolation level should be prepared for temporary serialization errors and retry such transactions in a meaningful manner.

  • Method Details

    • values

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

      public static TransactionIsolation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getLevel

      public int getLevel()
      Gets the low-level isolation level constant.
      Returns:
      the low level integer constant
      See Also:
    • valueOf

      public static TransactionIsolation valueOf(int level)
      Derives the transaction isolation enum from the low-level constant integer.
      Parameters:
      level - the low-level constant
      Returns:
      the transaction isolation, DEFAULT if no such level