Package tech.ydb.yoj.repository.db
Enum Class IsolationLevel
- All Implemented Interfaces:
Serializable,Comparable<IsolationLevel>,Constable
The transaction isolation level.
Defines how the changes made by one operation become visible to others.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe most recent consistent state of the database.The most recent inconsistent state of the database.All transactions are serialized one-by-one.An almost recent consistent state of the database. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether the transaction is read-only.booleanIndicates whether the transaction is read-write.static IsolationLevelReturns the enum constant of this class with the specified name.static IsolationLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SERIALIZABLE_READ_WRITE
All transactions are serialized one-by-one. If the DB detects a write collision among several concurrent transactions, only the first one is committed. This is the strongest level. And the only level at which data changes are possible. -
ONLINE_CONSISTENT_READ_ONLY
The most recent consistent state of the database. Read only. -
ONLINE_INCONSISTENT_READ_ONLY
The most recent inconsistent state of the database. Read only. A phantom read may occurs when, in the course of a transaction, some new rows are added by another transaction to the records being read. This is the weakest level. -
STALE_CONSISTENT_READ_ONLY
An almost recent consistent state of the database. Read only. This level is faster thenONLINE_CONSISTENT_READ_ONLY, but may return stale data.
-
-
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
-
isReadOnly
public boolean isReadOnly()Indicates whether the transaction is read-only. Callingcommit()orrollback()in a read-only transaction has no effect.- Returns:
trueif the transaction is read-only;falseotherwise- See Also:
-
isReadWrite
public boolean isReadWrite()Indicates whether the transaction is read-write.- Returns:
trueif the transaction is read-write;falseotherwise- See Also:
-