Enum IsolationLevel

java.lang.Object
java.lang.Enum<IsolationLevel>
org.apache.arrow.adbc.core.IsolationLevel
All Implemented Interfaces:
Serializable, Comparable<IsolationLevel>

public enum IsolationLevel extends Enum<IsolationLevel>
The isolation level to use for transactions when autocommit is disabled.
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The database or driver default isolation level.
    The central distinction between serializability and linearizability is that serializability is a global property; a property of an entire history of operations and transactions.
    Lock-based concurrency control keeps write locks until the end of the transaction, but read locks are released as soon as a SELECT is performed.
    The lowest isolation level.
    Lock-based concurrency control keeps read AND write locks (acquired on selection data) until the end of the transaction.
    Serializability requires read and write locks to be released only at the end of the transaction.
    This isolation guarantees that all reads in the transaction will see a consistent snapshot of the database and the transaction should only successfully commit if no updates conflict with any concurrent updates made since that snapshot.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DEFAULT

      public static final IsolationLevel DEFAULT
      The database or driver default isolation level.
    • READ_UNCOMMITTED

      public static final IsolationLevel READ_UNCOMMITTED
      The lowest isolation level. Dirty reads are allowed, so one transaction may see not-yet-committed changes made by others.
    • READ_COMMITTED

      public static final IsolationLevel READ_COMMITTED
      Lock-based concurrency control keeps write locks until the end of the transaction, but read locks are released as soon as a SELECT is performed. Non-repeatable reads can occur in this isolation level.

      More simply put, Read Committed is an isolation level that guarantees that any data read is committed at the moment it is read. It simply restricts the reader from seeing any intermediate, uncommitted, 'dirty' reads. It makes no promise whatsoever that if the transaction re-issues the read, it will find the same data; data is free to change after it is read.

    • REPEATABLE_READ

      public static final IsolationLevel REPEATABLE_READ
      Lock-based concurrency control keeps read AND write locks (acquired on selection data) until the end of the transaction.

      However, range-locks are not managed, so phantom reads can occur. Write skew is possible at this isolation level in some systems.

    • SNAPSHOT

      public static final IsolationLevel SNAPSHOT
      This isolation guarantees that all reads in the transaction will see a consistent snapshot of the database and the transaction should only successfully commit if no updates conflict with any concurrent updates made since that snapshot.
    • SERIALIZABLE

      public static final IsolationLevel SERIALIZABLE
      Serializability requires read and write locks to be released only at the end of the transaction. This includes acquiring range- locks when a select query uses a ranged WHERE clause to avoid phantom reads.
    • LINEARIZABLE

      public static final IsolationLevel LINEARIZABLE
      The central distinction between serializability and linearizability is that serializability is a global property; a property of an entire history of operations and transactions. Linearizability is a local property; a property of a single operation/transaction.

      Linearizability can be viewed as a special case of strict serializability where transactions are restricted to consist of a single operation applied to a single object.

  • Method Details

    • values

      public static IsolationLevel[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static IsolationLevel valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null