CS FundamentalsHardGATE CS

Timestamps: T1 = 10 (oldest), T2 = 20, T3 = 30. T2 holds an exclusive lock on X. First T1 requests X, then T3 requests X. Which is correct?

  1. A. Wait-die: T1 waits and T3 is rolled back; wound-wait: T2 is rolled back for T1, and T3 waits
  2. B. Wait-die: T1 is rolled back and T3 waits; wound-wait: T1 waits and T3 is rolled back
  3. C. Wait-die: both T1 and T3 wait; wound-wait: T2 is rolled back for both
  4. D. Wait-die: T1 waits and T3 waits; wound-wait: T1 and T3 are both rolled back

Correct answer: A. Wait-die: T1 waits and T3 is rolled back; wound-wait: T2 is rolled back for T1, and T3 waits

Wait-die: an older requester waits, a younger one dies, so T1 waits and T3 dies. Wound-wait: an older requester wounds (aborts) the younger holder, a younger requester waits, so T2 is aborted for T1 and T3 waits.

More DBMS and SQL questions

Exams that ask this topic