Package org.h2.engine

# Enum Class IsolationLevel

java.lang.Object
java.lang.Enum<IsolationLevel>
org.h2.engine.IsolationLevel

All Implemented Interfaces:
  `Serializable`, `Comparable<IsolationLevel>`, `Constable`

public enum IsolationLevel extends Enum<IsolationLevel>
Level of isolation.

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`READ_COMMITTED`
Dirty reads aren't allowed; non-repeatable reads and phantom reads are allowed.
`READ_UNCOMMITTED`
Dirty reads, non-repeatable reads and phantom reads are allowed.
`REPEATABLE_READ`
Dirty reads and non-repeatable reads aren't allowed; phantom reads are allowed.
`SERIALIZABLE`
Dirty reads, non-repeatable reads and phantom reads are'n allowed.
`SNAPSHOT`
Dirty reads, non-repeatable reads and phantom reads are'n allowed.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`allowNonRepeatableRead()`
Returns whether a non-repeatable read phenomena is allowed.
`static IsolationLevel`
`fromJdbc(int level)`
Returns the isolation level from LOCK_MODE equivalent for PageStore and old versions of H2.
`static IsolationLevel`
`fromLockMode(int lockMode)`
Returns the isolation level from LOCK_MODE equivalent for PageStore and old versions of H2.
`static IsolationLevel`
`fromSql(String sql)`
Returns the isolation level from its SQL name.
`int`
`getJdbc()`
Returns the JDBC constant for this isolation level.
`int`
`getLockMode()`
Returns the LOCK_MODE equivalent for PageStore and old versions of H2.
`String`
`getSQL()`
Returns the SQL representation of this isolation level.
`static IsolationLevel`
`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static IsolationLevel[]`
`values()`
Returns an array containing the constants of this enum class, in the order they are declared.

### Methods inherited from class java.lang.Enum

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

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### READ_UNCOMMITTED

public static final IsolationLevel READ_UNCOMMITTED
Dirty reads, non-repeatable reads and phantom reads are allowed.

### READ_COMMITTED

public static final IsolationLevel READ_COMMITTED
Dirty reads aren't allowed; non-repeatable reads and phantom reads are allowed.

### REPEATABLE_READ

public static final IsolationLevel REPEATABLE_READ
Dirty reads and non-repeatable reads aren't allowed; phantom reads are allowed.

### SNAPSHOT

public static final IsolationLevel SNAPSHOT
Dirty reads, non-repeatable reads and phantom reads are'n allowed.

### SERIALIZABLE

public static final IsolationLevel SERIALIZABLE
Dirty reads, non-repeatable reads and phantom reads are'n allowed. Concurrent and serial execution of transactions with this isolation level should have the same effect.

## Method Details

### values

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

Returns:
  an array containing the constants of this enum class, in the order they are declared

### valueOf

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

### fromJdbc

public static IsolationLevel fromJdbc(int level)
Returns the isolation level from LOCK_MODE equivalent for PageStore and old versions of H2.

Parameters:
  `level` - the LOCK_MODE value
Returns:
  the isolation level

### fromLockMode

public static IsolationLevel fromLockMode(int lockMode)
Returns the isolation level from LOCK_MODE equivalent for PageStore and old versions of H2.

Parameters:
  `lockMode` - the LOCK_MODE value
Returns:
  the isolation level

### fromSql

public static IsolationLevel fromSql(String sql)
Returns the isolation level from its SQL name.

Parameters:
  `sql` - the SQL name
Returns:
  the isolation level from its SQL name

### getSQL

public String getSQL()
Returns the SQL representation of this isolation level.

Returns:
  SQL representation of this isolation level

### getJdbc

public int getJdbc()
Returns the JDBC constant for this isolation level.

Returns:
  the JDBC constant for this isolation level

### getLockMode

public int getLockMode()
Returns the LOCK_MODE equivalent for PageStore and old versions of H2.

Returns:
  the LOCK_MODE equivalent

### allowNonRepeatableRead

public boolean allowNonRepeatableRead()
Returns whether a non-repeatable read phenomena is allowed.

Returns:
  whether a non-repeatable read phenomena is allowed