Which protocol is satisfied by following transaction: LOCK – X(A) LOCK – S(B)…
Which protocol is satisfied by following transaction:
LOCK – X(A)
LOCK – S(B)
R(A)
R(B)
W(A)
UNLOCK(A)
COMMIT
UNLOCK(B)
Answer: C. Conservative 2PL — To determine which protocol is satisfied, analyze the transaction step by step against the rules of each 2PL variant. Step 1: Check the lock acquisition…
- A.
Strict 2PL
- B.
Rigorous 2PL
- C.
Conservative 2PL
- D.
None of the above
Attempted by 70 students.
Show answer & explanation
Correct answer: C
To determine which protocol is satisfied, analyze the transaction step by step against the rules of each 2PL variant.
Step 1: Check the lock acquisition order. The transaction begins with LOCK-X(A) and LOCK-S(B), meaning all required locks are acquired before any read or write operations.
Step 2: Check lock release timing. The transaction performs R(A), R(B), W(A), then COMMIT, followed by UNLOCK(A) and UNLOCK(B). Exclusive locks are released after commit.
Step 3: Evaluate against 2PL variants. Conservative 2PL requires all locks to be acquired before any operation and released only after the transaction completes. This matches the given transaction.
Step 4: Check strict 2PL. In strict 2PL, exclusive locks must be held until commit. Here, UNLOCK(A) occurs after COMMIT, so it does not satisfy strict 2PL.
Step 5: Check rigorous 2PL. Rigorous 2PL requires all locks to be held until commit. Since exclusive locks are released after commit, this does not satisfy rigorous 2PL.
Conclusion: The transaction satisfies conservative 2PL.