CS FundamentalsModerateGATE CS (PYQ pattern)

Under strict 2PL, T1 and T2 both hold S(A) and each now requests X(A) (a lock upgrade). T3 holds S(B) and requests X(A). T4 holds X(C) and requests S(B). Which transactions are deadlocked?

  1. A. T1, T2 and T3
  2. B. None, because shared locks never conflict
  3. C. T3 and T4
  4. D. T1 and T2 only

Correct answer: D. T1 and T2 only

T1's upgrade waits for T2's S(A) and vice versa: a 2-cycle. T3 waits for T1 and T2 but nothing waits on T3 in a cycle, so T3 is blocked behind the deadlock, not part of it. T4's S(B) is compatible with T3's S(B) and is granted.

More DBMS and SQL questions

Exams that ask this topic