Java Database Connectivity Question:

What are different types of Transaction Isolation Levels?

Answer:

The isolation level describes the degree to which the data being updated is visible to other transactions. This is important when two transactions are trying to read the same row of a table. Imagine two transactions: A and B. Here three types of inconsistencies can occur:

* Dirty-read: A has changed a row, but has not committed the changes. B reads the uncommitted data but his view of the data may be wrong if A rolls back his changes and updates his own changes to the database.
* Non-repeatable read: B performs a read, but A modifies or deletes that data later. If B reads the same row again, he will get different data.
* Phantoms: A does a query on a set of rows to perform an operation. B modifies the table such that a query of A would have given a different result. The table may be inconsistent.