Which of the following statements about the Two Phase Locking () protocol is/are TRUE?
View worked solution
Answer: A;C;D
Let us analyze each statement regarding the Two-Phase Locking (2PL) protocol:
-
Statement A: permits only serializable schedules (TRUE)
The fundamental theorem of 2PL states that any schedule generated by a set of transactions adhering to the 2PL protocol is guaranteed to be conflict serializable, and therefore serializable. -
Statement B: With , a transaction always locks the data item being read or written just before every operation and always releases the lock just after the operation (FALSE)
If a transaction releases a lock immediately after an operation and later attempts to acquire another lock, it violates the 2PL rule. In 2PL, all lock acquisitions must precede any lock releases. -
Statement C: With , 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 (TRUE)
This is the defining property of 2PL. A transaction is divided into two phases:- Growing Phase: The transaction may obtain locks but cannot release any.
- Shrinking Phase: The transaction may release locks but cannot obtain any new ones.
-
Statement D: A deadlock is possible with (TRUE)
Basic 2PL does not prevent deadlocks. For example, consider two transactions:- locks data item and waits to lock .
- locks data item and waits to lock .
Therefore, statements A, C, and D are TRUE.
Free practice · Your answers on this page are not saved.
