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?
- A. T1 waits for T2, and T3 is rolled back
- B. T1 is rolled back, and T3 waits for T2
- C. T2 is rolled back (wounded) by T1, and T3 waits
- 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
- T1 and T2 run the schedule R1(A), W2(A), R1(B), C1, C2, and each transaction may acquire any lock as early as it likes. Under which…
- Under snapshot isolation, x = 50 and y = 50 with the rule x + y ≥ 0. T1 reads x and y and, if x + y ≥ 100, sets x = x − 100. T2…
- How many of these statements are correct? (i) Under multiversion timestamp ordering, a read request is never rejected. (ii) Thomas' write…
- During ARIES restart, the analysis pass rebuilds a dirty page table with entries P1 (recLSN 140), P2 (recLSN 95) and P3 (recLSN 210). The…
- Table Emp(eid, name, mgr, dept, sal) rows: (1, 'Aru', NULL, 'D1', 90), (2, 'Bin', 1, 'D1', 60), (3, 'Cy', 1, 'D2', 70), (4, 'Dev', 2…
- Table Emp(eid, name, mgr, dept, sal) rows: (1, 'Aru', NULL, 'D1', 90), (2, 'Bin', 1, 'D1', 60), (3, 'Cy', 1, 'D2', 70), (4, 'Dev', 2…