Computer Sciences > GATE 2024 Set-2 > DBMS
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
A
2PL permits only serializable schedules
B
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
C
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
D
A deadlock is possible with 2PL

Correct : a,c

To determine the correct statements about the Two-Phase Locking (2PL) protocol, let us analyze the structural rules and execution characteristics of the protocol
a) 2PL permits only serializable schedules:
The core theoretical guarantee of the Two-Phase Locking protocol is that it ensures conflict serializability. Any schedule that strictly follows the rules of 2PL is guaranteed to be serializable, and it completely prevents any data inconsistency or non-serializable interleaving.
This statement is TRUE.

b) Continuous lock and release behavior:
The statement describes a lock-before-operation and release-immediately-after behavior. This is not how 2PL works; instead, that describes basic arbitrary locking, which can easily lead to non-serializable schedules. 2PL explicitly prevents this by forcing transactions to accumulate locks over time rather than dropping them immediately.
This statement is FALSE.

c) The lock release rule:
The central rule of 2PL states that a transaction is divided into two distinct phases:
    1. Growing Phase: The transaction may obtain locks but cannot release any.
    2. Shrinking Phase: The transaction may release locks but cannot obtain any new ones.
Therefore, the moment the very first lock is released, the transaction enters its shrinking phase and is strictly forbidden from acquiring any further locks.
This statement is TRUE.

d) A deadlock is possible with 2PL:
While basic 2PL guarantees serializability, it does not prevent deadlocks. For example, if Transaction 1 holds a lock on item A and requests a lock on item B, while Transaction 2 holds a lock on item B and requests a lock on item A, both transactions will wait indefinitely for each other to release their respective locks.
This statement is TRUE.
Conclusion: The correct statements are a, c, and d.

Similar Questions

Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes a...
#907 MCQ
Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?
#914 MSQ
A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters. From...
#1 MCQ

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......