public enum TransactionIsolation extends Enum<TransactionIsolation>
Enum Constant and Description |
---|
NONE
For engines that support it, none isolation means that each statement would essentially be its own transaction.
|
READ_COMMITTED
Specifies that shared locks are held while the data is being read to avoid dirty reads, but the data can be changed
before the end of the transaction, resulting in nonrepeatable reads or phantom data.
|
READ_UNCOMMITTED
Implements dirty read, or isolation level 0 locking, which means that no shared locks are issued and no exclusive
locks are honored.
|
REPEATABLE_READ
Locks are placed on all data that is used in a query, preventing other users from updating the data, but new
phantom rows can be inserted into the data set by another user and are included in later reads in the current
transaction.
|
SERIALIZABLE
Places a range lock on the data set, preventing other users from updating or inserting rows into the data set until
the transaction is complete.
|
Modifier and Type | Method and Description |
---|---|
static TransactionIsolation |
from(int level) |
static TransactionIsolation |
from(String level) |
int |
getType() |
static TransactionIsolation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TransactionIsolation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TransactionIsolation READ_UNCOMMITTED
public static final TransactionIsolation READ_COMMITTED
public static final TransactionIsolation REPEATABLE_READ
public static final TransactionIsolation SERIALIZABLE
public static final TransactionIsolation NONE
public static TransactionIsolation[] values()
for (TransactionIsolation c : TransactionIsolation.values()) System.out.println(c);
public static TransactionIsolation valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getType()
public static TransactionIsolation from(int level)
public static TransactionIsolation from(String level)
Copyright © 2023 Eclipse. All rights reserved.