Skip to main content

GATE CSE 2016Databases › Transactions, Concurrency Control & IndexingVerified

GATE CSE 2016 PYQ: Consider the following two phase locking protocol. Suppose a transaction T T T accesses (for read or write…

Consider the following two phase locking protocol. Suppose a transaction TT accesses (for read or write operations), a certain set of objects {O1,…,Ok}\{O_1,\ldots,O_k \}. This is done in the following manner:

  • Step 1\text{Step 1}. TT acquires exclusive locks to O1,…,OkO_1,\ldots,O_k in increasing order of their addresses.
  • Step 2\text{Step 2}. The required operations are performed .
  • Step 3\text{Step 3}. All locks are released

This protocol will

  1. A
    guarantee serializability and  deadlock-freedom
    Correct answer
  2. B
    guarantee neither serializability nor deadlock-freedom
  3. C
    guarantee serializability but not deadlock-freedom
  4. D
    guarantee deadlock-freedom but not serializability.

Answer

(A) guarantee serializability and deadlock-freedom

Approach

Identify the protocol as a form of conservative two-phase locking with ordered lock acquisition. Check each guarantee separately: (1) serializability via two-phase locking, and (2) deadlock-freedom via the global address order.

The protocol is conservative 2PL with ordered acquisition. Two-phase locking ensures serializability, and the total address order eliminates circular wait, ensuring deadlock-freedom. Therefore option A is correct.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.