Wednesday, June 13, 2012

Database Isolation levels

Isolation levels :


TRANSACTION_SERIALIZABLE: Strongest level of isolation. 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. Can produce deadlocks.

TRANSACTION_REPEATABLE_READ: Locks are placed on all data that is used in a query, preventing other users from

updating the data, but new phantom records can be inserted into the data set

by another user and are included in later reads in the current transaction.

TRANSACTION_READ_COMMITTED: Can't read uncommitted data by another transaction. 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 non-repeatable reads and phantom

records.

TRANSACTION_READ_UNCOMMITTED:

Can read uncommitted data (dirty read) by another transaction, and nonrepeatable

reads and phantom records are possible. Least restrictive of all

isolation levels. No shared locks are issued and no exclusive locks are

honoured.

No comments: