public enum IsolationLevel extends java.lang.Enum<IsolationLevel>
Two isolation levels are supported: serializable and snapshot isolation. Both of them provide a read consistent view of the table to all operations and allow readers to see only already committed data. While serializable is the strongest isolation level in databases, snapshot isolation is beneficial for environments with many concurrent writers.
The serializable isolation level guarantees that an ongoing UPDATE/DELETE/MERGE operation fails if a concurrent transaction commits a new file that might contain rows matching the condition used in UPDATE/DELETE/MERGE. For example, if there is an ongoing update on a subset of rows and a concurrent transaction adds a new file with records that potentially match the update condition, the update operation must fail under the serializable isolation but can still commit under the snapshot isolation.
Enum Constant and Description |
---|
SERIALIZABLE |
SNAPSHOT |
Modifier and Type | Method and Description |
---|---|
static IsolationLevel |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static IsolationLevel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IsolationLevel SERIALIZABLE
public static final IsolationLevel SNAPSHOT
public static IsolationLevel[] values()
for (IsolationLevel c : IsolationLevel.values()) System.out.println(c);
public static IsolationLevel valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null