PPT Slide
2PL Theorem: If all transactions in an execution are two-phase locked, then the execution is SR.
Proof: Define Ti ? Tk if either
- Ti read x and Tk later wrote x, or
- Ti wrote x and Tk later read or wrote x
If Ti ? Tk, then Ti released a lock before Tk obtained some lock.
If Ti ? Tk ? Tm, then Ti released a lock before Tm obtained some lock (because Tk is two-phase).
If Ti ?... ? Ti, then Ti released a lock before Ti obtained some lock, breaking the 2-phase rule.
So there cannot be a cycle. By the Serializability Theorem, the execution is SR.