Read uncommitted
(level 0)
|
- Read permitted on row with or without write lock
- No read locks are applied
- No guarantee that concurrent transaction will not modify row or roll
back changes to row
- Corresponds to table hints NOLOCK and
READUNCOMMITTED
- Allow dirty reads, non-repeatable reads, and phantom rows
|
Read committed
(level 1)
|
- Read only permitted on row with no write lock
- Read lock acquired and held for read on current row only, but released
when cursor moves off the row
- No guarantee that data will not change during transaction
- Corresponds to table hint READCOMMITTED
- Prevent dirty reads
- Allow non-repeatable reads and phantom rows
|
Repeatable read
(level 2)
|
- Read only permitted on row with no write lock
- Read lock acquired as each row in the result set is read, and held until
transaction ends
- corresponds to table hint REPEATABLEREAD
- Prevent dirty reads and non-repeatable reads
- Allow phantom rows
|
Serializable
(level 3)
|
- Read only permitted on rows in result without write lock
- Read locks acquired when cursor is opened and held until transaction
ends
- Corresponds to table hints HOLDLOCK and
SERIALIZABLE
- Prevent dirty reads, non-repeatable reads, and phantom rows
|
Snapshot |
- No read locks are applied
- Read permitted on any row
- Database snapshot of committed data is taken when the first row is read
or updated by the transaction
|
Share mode
(Default)
|
- Obtains a shared table lock on the table, preventing other transactions
from modifying the table but allowing them read access.
- If a transaction puts a shared lock on a table, it can change data in
the table provided no other transaction holds a lock of any kind on the
row(s) being modified.
|
Exclusive mode |
- Obtains an exclusive table lock on the table, preventing other
transactions from accessing the table. No other transaction can execute
queries, updates, or any other action against the table.
|