CS FundamentalsVery hardGATE CS (PYQ pattern)

T1: W(A) W(B) and T2: W(B) W(A) run under strict 2PL (exclusive locks held until the transaction ends; a schedule counts only if no operation ever has to wait). Out of the 6 interleavings, how many are valid strict-2PL schedules?

  1. A. 2
  2. B. 0
  3. C. 1
  4. D. 4

Correct answer: A. 2

A valid schedule needs one transaction to finish both writes before the other touches either item, because each transaction holds both locks until its last operation. Only the two serial orders qualify.

More DBMS and SQL questions

Exams that ask this topic