Two-Phase Locking and Serial Order
Separate a transaction’s growing and shrinking lock phases and use its last acquisition to explain conflict serializability.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Once lock release begins, acquisition ends
Two-phase locking requires each transaction to acquire locks only before it starts releasing them, with modes that conflict as the modeled operations do. Transactions can release at different times. Strict variants keep specified write locks through commit or abort to aid recovery and prevent access to unfinished changes.
Last acquisition orders conflicting transactions
If a conflicting operation of A occurs before B’s access to the same protected item, B must acquire its conflicting lock after A releases the relevant lock. A’s last acquisition lies before that release. B’s last acquisition lies at or after its conflicting acquisition. Ordering by the last acquisition therefore respects the conflict edges in this model. Waiting can still cause deadlock. Precedence graphs define the serializability claim.[1][2]