2 Phase Locking
In databases and transaction processing, two-phase locking (2PL) is a concurrency control method that guarantees serializability


- Growing Phase: New locks on data items may be acquired but none can be released.
- Shrinking Phase: Existing locks may be released but no new locks can be acquired.
Two major types of locks are used:
- Write-lock (exclusive lock) is associated with a database object by a transaction (Terminology: "the transaction locks the object," or "acquires lock for it") before writing (inserting/modifying/deleting) this object.
- Read-lock (shared lock) is associated with a database object by a transaction before reading (retrieving the state of) this object.