|
Shared locks
When a statement reads data without making any modifications, its
transaction obtains a shared lock on the data.
Another transaction that tries to read the same data is permitted to read,
but a transaction that tries to update the data will be prevented from doing
so until the shared lock is released. How long this shared lock is held depends
on the isolation level of the transaction holding the lock. Transactions using
the TRANSACTION_READ_COMMITTED isolation level release the lock when the transaction
steps through to the next row. Transactions using the TRANSACTION_SERIALIZABLE
or TRANSACTION_REPEATABLE_READ isolation level hold the lock until the transaction
is committed, so even a SELECT can prevent updates if a commit is never issued.
Transactions using the TRANSACTION_READ_UNCOMMITTED isolation level do not
request any locks.
|