- All Implemented Interfaces:
Serializable
,Comparable<TransactionIsolation>
,Constable
Enum that maps the low-level integer constants of the transaction isolation levels in
java.sql.Connection
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDefault transaction isolation.
Usually READ_COMMITTED.Transactions are not supported at all.Dirty 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 TypeMethodDescriptionint
getLevel()
Gets the low-level isolation level constant.static TransactionIsolation
valueOf
(int level) Derives the transaction isolation enum from the low-level constant integer.static TransactionIsolation
Returns 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
-
DEFAULT
Default transaction isolation.
Usually READ_COMMITTED. -
NONE
Transactions are not supported at all. -
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.This is usually the default for most databases.
-
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
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
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
-
getLevel
public int getLevel()Gets the low-level isolation level constant.- Returns:
- the low level integer constant
- See Also:
-
valueOf
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
-