Enum Class IsolationLevel

java.lang.Object
java.lang.Enum<IsolationLevel>
tech.ydb.yoj.repository.db.IsolationLevel
All Implemented Interfaces:
Serializable, Comparable<IsolationLevel>, Constable

public enum IsolationLevel extends Enum<IsolationLevel>
The transaction isolation level. Defines how the changes made by one operation become visible to others.
See Also:
  • Enum Constant Details

    • SERIALIZABLE_READ_WRITE

      public static final IsolationLevel 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

      public static final IsolationLevel ONLINE_CONSISTENT_READ_ONLY
      The most recent consistent state of the database. Read only.
    • ONLINE_INCONSISTENT_READ_ONLY

      public static final IsolationLevel 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

      public static final IsolationLevel STALE_CONSISTENT_READ_ONLY
      An almost recent consistent state of the database. Read only. This level is faster then ONLINE_CONSISTENT_READ_ONLY, but may return stale data.
  • Method Details

    • values

      public static IsolationLevel[] 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 IsolationLevel 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
    • isReadOnly

      public boolean isReadOnly()
      Indicates whether the transaction is read-only. Calling commit() or rollback() in a read-only transaction has no effect.
      Returns:
      true if the transaction is read-only; false otherwise
      See Also:
    • isReadWrite

      public boolean isReadWrite()
      Indicates whether the transaction is read-write.
      Returns:
      true if the transaction is read-write; false otherwise
      See Also: