Enum IsolationLevels
- All Implemented Interfaces:
Serializable
,Comparable<IsolationLevels>
,IsolationLevel
,TransactionSetting
Enumeration of Transaction
IsolationLevel
s supported by Sesame. Note that Sesame 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 ConstantDescriptionNone: 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 guaranteedRead 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 toSNAPSHOT
, 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 toSNAPSHOT_READ
, successful transactions in this isolation level will operate against a particular dataset snapshot.Snapshot Read: in addition toREAD_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 TypeMethodDescriptionstatic IsolationLevel
getCompatibleIsolationLevel
(IsolationLevel level, List<? extends IsolationLevel> supportedLevels) Determines the first compatible isolation level in the list of supported levels, for the given level.boolean
isCompatibleWith
(IsolationLevel otherLevel) 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.static IsolationLevels
Returns the enum constant of this type with the specified name.static IsolationLevels[]
values()
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 interface org.eclipse.rdf4j.common.transaction.IsolationLevel
getName, getValue
-
Enum Constant Details
-
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
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
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
Snapshot Read: in addition toREAD_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
Snapshot: in addition toSNAPSHOT_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
Serializable: in addition toSNAPSHOT
, 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
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
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 nameNullPointerException
- if the argument is null
-
isCompatibleWith
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 interfaceIsolationLevel
- 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
- theIsolationLevel
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 isnull
.
-