Two-phase locking (2PL) is a concurrency control protocol that determines whether a txn can access an object in the database on the fly.
The protocol does not need to know all the queries that a txn will execute ahead of time.
It’s sufficient to guarantee conflict serializability, since it generates schedules whose precedence graph is acyclic
Phase #1: Growing
Each txn requests the locks that it needs from the DBMS’s lock manager.
The lock manager grants/denies lock requests.
Phase #2: Shrinking