Important properties of two phase locking protocol and its variants
Properties of 2PL
- 2PL ensures conflict serializability.
- Growing phase
- All the data items must be locked with the required locks (either read lock or write lock) well before accessing those data items. [called Growing phase]
- Upgrading of locks can only be done during Growing phase.
- Shrinking phase
- Once the lock is released, the transaction cannot get any new locks during the execution of that particular transaction. [called Shrinking phase].
- Downgrading of locks can only be done during Shrinking phase.
- Lock point
- The end of growing phase (acquiring the final lock of a transaction) is called lock point.
- 2PL does not guarantee freedom from deadlock. Deadlock may happen under two phase locking.
- Cascading rollback
- Cascading rollback may occur under 2PL.
- Variants of 2PL
- strict 2PL and rigorous 2PL.