CS FundamentalsVery hardGATE CS
Timestamp ordering with Thomas's write rule: TS(T1) = 5, TS(T2) = 10, TS(T3) = 15, and all read/write timestamps start at 0. The operations arrive as W2(A), R3(B), W1(A), W1(B). What happens to T1?
- A. T1 completes; W1(A) is ignored as obsolete
- B. T1 is rolled back at W1(A) because a younger transaction wrote A
- C. T1 is rolled back at W1(B), after W1(A) was ignored
- D. T1 completes; W1(A) overwrites T2's value
Correct answer: C. T1 is rolled back at W1(B), after W1(A) was ignored
W1(A): W-ts(A) = 10 > 5 and R-ts(A) = 0, so Thomas's rule skips the outdated write. W1(B): R-ts(B) = 15 > 5, meaning a younger transaction already read B, so T1 must be rolled back. Basic TO (without Thomas) would have aborted at W1(A).
More DBMS and SQL questions
- 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?
- A hospital requires at least one doctor on call. Doctors Ana and Ben are both on call. Each starts a transaction under snapshot isolation…
- An account has balance 1000. Two sessions at READ COMMITTED each run SELECT bal (both read 1000 before either writes), then compute 1000 −…
- Two transactions each read row X under a shared lock and later want to update it, so each requests an upgrade to an exclusive lock. What…
- After ARIES analysis the dirty page table holds P1 (recLSN 40), P2 (recLSN 25) and P3 (recLSN 60); the last checkpoint began at LSN 30…
- A DBMS uses deferred database modification: no change reaches the database before its transaction commits (NO-STEAL), but committed…