📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

What is two-phase locking?

A. Locking two tables at once
B. Locking a table twice
C. A protocol where a transaction acquires locks in a growing phase and releases them in a shrinking phase ✅
D. A backup in two steps

Correct Answer: C. A protocol where a transaction acquires locks in a growing phase and releases them in a shrinking phase

Explanation

  • Two-phase locking has a growing phase for acquiring locks and a shrinking phase for releasing them.
  • It guarantees serializability.