CS FundamentalsHardGATE CS · Amazon/Microsoft SDE MCQ

TS(T1) = 5, TS(T2) = 10, TS(T3) = 15. T2 holds an exclusive lock on X; then T1 and T3 each request X. What happens under wound-wait?

  1. A. T1 waits for T2, and T3 is rolled back
  2. B. T1 is rolled back, and T3 waits for T2
  3. C. T2 is rolled back (wounded) by T1, and T3 waits
  4. D. T1 and T3 both wait, since neither holds a lock T2 needs

Correct answer: C. T2 is rolled back (wounded) by T1, and T3 waits

In wound-wait an older requester wounds (aborts) the younger holder, while a younger requester waits. T1 (5) is older than T2 (10), so T2 is rolled back; T3 (15) is younger and waits. Option A describes wait-die.

More DBMS and SQL questions

Exams that ask this topic