- All Implemented Interfaces:
Serializable,Comparable<TransactionIsolation>,Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDirty reads are prevented; non-repeatable reads and phantom reads can occur.Dirty reads, non-repeatable reads, and phantom reads can occur.Dirty reads and non-repeatable reads are prevented; phantom reads can occur.Dirty reads, non-repeatable reads, and phantom reads are prevented. -
Method Summary
Modifier and TypeMethodDescriptionstatic TransactionIsolationfromJdbcLevel(int jdbcLevel) Returns the isolation level for the given JDBC constant.intThe correspondingConnectionisolation constant.static TransactionIsolationReturns the enum constant of this class with the specified name.static TransactionIsolation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
READ_UNCOMMITTED
Dirty reads, non-repeatable reads, and phantom reads can occur. -
READ_COMMITTED
Dirty reads are prevented; non-repeatable reads and phantom reads can occur. -
REPEATABLE_READ
Dirty reads and non-repeatable reads are prevented; phantom reads can occur. -
SERIALIZABLE
Dirty reads, non-repeatable reads, and phantom reads are prevented.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
jdbcLevel
public int jdbcLevel()The correspondingConnectionisolation constant. -
fromJdbcLevel
Returns the isolation level for the given JDBC constant.- Parameters:
jdbcLevel- aConnectionisolation constant.- Throws:
IllegalArgumentException- if the constant does not map to an isolation level.
-