An isolation level defines how concurrent transactions accessing a RDBMS are isolated from one another for read purposes.
The following isolation levels are generally supported in any RDBMS.
These levels are defined in the ANSI SQL92 standard in terms of three possible occurrences that must be prevented between concurrent transactions.
Dirty reads: A transaction reads a row in a database table containing uncommitted changes from another transaction.
Nonrepeatable reads: A transaction reads a row in a database table, a second transaction changes the same row and
the first transaction re-reads the row and gets a different value.
Phantom reads: A transaction re-executes a query, returning a set of rows that satisfies a search condition and finds that another
committed transaction has inserted additional rows that satisfy the condition.
The table below lists the 5 isolation levels followed with a corresponding description .
Transaction Isolation Levels
TRANSACTION_READ_COMMITTED: This level results in the prevention of a transaction from reading uncommitted changes in other concurrent transactions.
This level ensures that dirty reads are not possible.
TRANSACTION_READ_UNCOMMITTED:The transaction can read uncommitted data, i.e., data being changed by another transaction concurrently.
TRANSACTION_REPEATABLE_READ: In addition to the prevention associated with TRANSACTION_READ_COMMITTED, this level ensures that reading the same data multiple times
will receive the same value even if another transaction modifies the data. Methods with this isolation level, besides having the same behavior as TRANSACTION_READ_COMMITTED,
can only execute repeatable reads.
TRANSACTION_SERIALIZABLE: The transaction has exclusive read and update privileges to data by locking it;
other transactions can neither write nor read the same data. It is the most restrictive transaction isolation level and it ensures that if a query retrieves a result set based on a predicate condition and
another transaction inserts data that satisfy the predicate condition, re-execution of the query will return the same result set.