Enum IsolationLevels

java.lang.Object
java.lang.Enum<IsolationLevels>
org.eclipse.rdf4j.common.transaction.IsolationLevels
All Implemented Interfaces:
Serializable, Comparable<IsolationLevels>, IsolationLevel, TransactionSetting

public enum IsolationLevels extends Enum<IsolationLevels> implements IsolationLevel
Enumeration of Transaction IsolationLevels supported by RDF4J. Note that RDF4J stores are not required to support all levels, consult the documentatation for the specific SAIL implementation you are using to find out which levels are supported.
Author:
Jeen Broekstra, James Leigh
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    None: the lowest isolation level; transactions can see their own changes, but may not be able to roll them back and no support for isolation among transactions is guaranteed
    Read Committed: in this isolation level only statements from other transactions that have been committed (at some point) can be seen by this transaction.
    Read Uncommitted: transactions can be rolled back, but not necessarily isolated: concurrent transactions might see each other's uncommitted data (so-called 'dirty reads')
    Serializable: in addition to SNAPSHOT, this isolation level requires that all other successful transactions must appear to occur either completely before or completely after a successful serializable transaction.
    Snapshot: in addition to SNAPSHOT_READ, successful transactions in this isolation level will operate against a particular dataset snapshot.
    Snapshot Read: in addition to READ_COMMITTED, query results in this isolation level that are observed within a successful transaction will observe a consistent snapshot.
  • Field Summary

    Fields inherited from interface org.eclipse.rdf4j.common.transaction.IsolationLevel

    NAME
  • Method Summary

    Modifier and Type
    Method
    Description
    getCompatibleIsolationLevel(IsolationLevel level, List<? extends IsolationLevel> supportedLevels)
    Determines the first compatible isolation level in the list of supported levels, for the given level.
    boolean
    Verifies if this transaction isolation level is compatible with the supplied other isolation level - that is, if this transaction isolation level offers at least the same guarantees as the other level.
    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

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

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.rdf4j.common.transaction.IsolationLevel

    getName, getValue
  • Enum Constant Details

    • NONE

      public static final IsolationLevels NONE
      None: the lowest isolation level; transactions can see their own changes, but may not be able to roll them back and no support for isolation among transactions is guaranteed
    • READ_UNCOMMITTED

      public static final IsolationLevels READ_UNCOMMITTED
      Read Uncommitted: transactions can be rolled back, but not necessarily isolated: concurrent transactions might see each other's uncommitted data (so-called 'dirty reads')
    • READ_COMMITTED

      public static final IsolationLevels READ_COMMITTED
      Read Committed: in this isolation level only statements from other transactions that have been committed (at some point) can be seen by this transaction.
    • SNAPSHOT_READ

      public static final IsolationLevels SNAPSHOT_READ
      Snapshot Read: in addition to READ_COMMITTED, query results in this isolation level that are observed within a successful transaction will observe a consistent snapshot. Changes to the data occurring while a query is evaluated will not affect that query result.
    • SNAPSHOT

      public static final IsolationLevels SNAPSHOT
      Snapshot: in addition to SNAPSHOT_READ, successful transactions in this isolation level will operate against a particular dataset snapshot. Transactions in this isolation level will see either the complete effects of other transactions (consistently throughout) or not at all.
    • SERIALIZABLE

      public static final IsolationLevels SERIALIZABLE
      Serializable: in addition to SNAPSHOT, this isolation level requires that all other successful transactions must appear to occur either completely before or completely after a successful serializable transaction.
  • Method Details

    • values

      public static IsolationLevels[] 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 IsolationLevels 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
    • isCompatibleWith

      public boolean isCompatibleWith(IsolationLevel otherLevel)
      Description copied from interface: IsolationLevel
      Verifies if this transaction isolation level is compatible with the supplied other isolation level - that is, if this transaction isolation level offers at least the same guarantees as the other level. By definition, every transaction isolation level is compatible with itself.
      Specified by:
      isCompatibleWith in interface IsolationLevel
      Parameters:
      otherLevel - an other isolation level to check compatibility against.
      Returns:
      true iff this isolation level is compatible with the supplied other isolation level, false otherwise.
    • getCompatibleIsolationLevel

      public static IsolationLevel getCompatibleIsolationLevel(IsolationLevel level, List<? extends IsolationLevel> supportedLevels)
      Determines the first compatible isolation level in the list of supported levels, for the given level. Returns the level itself if it is in the list of supported levels. Returns null if no compatible level can be found.
      Parameters:
      level - the IsolationLevel for which to determine a compatible level.
      supportedLevels - a list of supported isolation levels from which to select the closest compatible level.
      Returns:
      the given level if it occurs in the list of supported levels. Otherwise, the first compatible level in the list of supported isolation levels, or null if no compatible level can be found.
      Throws:
      IllegalArgumentException - if either one of the input parameters is null.