Package st.orm

Enum Class TransactionIsolation

All Implemented Interfaces:
Serializable, Comparable<TransactionIsolation>, Constable

public enum TransactionIsolation extends Enum<TransactionIsolation>
Transaction isolation levels, mapping to the JDBC isolation constants.

There is no DEFAULT member: leaving the isolation unset means the provider's (typically the database's) default applies.

Since:
1.13
  • Enum Constant Details

    • 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.
    • REPEATABLE_READ

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

      public static final TransactionIsolation SERIALIZABLE
      Dirty reads, non-repeatable reads, and phantom reads are prevented.
  • 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
    • jdbcLevel

      public int jdbcLevel()
      The corresponding Connection isolation constant.
    • fromJdbcLevel

      public static TransactionIsolation fromJdbcLevel(int jdbcLevel)
      Returns the isolation level for the given JDBC constant.
      Parameters:
      jdbcLevel - a Connection isolation constant.
      Throws:
      IllegalArgumentException - if the constant does not map to an isolation level.