Question:

Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?

Show Hint

2PL ensures serializability but does not prevent deadlocks. Use techniques like timeout or wait-die to handle deadlocks in 2PL.
Updated On: Jan 23, 2025
  • 2PL permits only serializable schedules
  • With 2PL, a transaction always locks the data item being read or written just before every operation and always releases the lock just after the operation
  • With 2PL, once a lock is released on any data item inside a transaction, no more locks on any data item can be obtained inside that transaction
  • A deadlock is possible with 2PL
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

The Two Phase Locking (2PL) protocol ensures two distinct phases: the growing phase (acquiring locks) and the shrinking phase (releasing locks).
Option (A): 2PL permits only serializable schedules by ensuring conflict-serializability. Hence, (A) is correct.
Option (B): This statement is incorrect because locks are not acquired and released immediately for every operation. Locks are held until the shrinking phase.
Option (C): In 2PL, once a lock is released during the shrinking phase, no new locks can be acquired. This is a key property of 2PL. Hence, (C) is correct.
Option (D): Deadlocks can occur in 2PL due to circular wait conditions. Hence, (D) is correct. Final Answer: \[ \boxed{\text{(A), (C), (D)}} \]
Was this answer helpful?
0
0

Questions Asked in GATE CS exam

View More Questions