CS FundamentalsVery hardProduct company interview · GATE level
No transaction has committed yet in the schedule W1(A); R2(A); W2(B); R3(B); W4(B); R5(B). T1 now aborts. Besides T1, which transactions must be rolled back?
- A. T2, T3 and T5
- B. T2 only
- C. T2, T3, T4 and T5
- D. T2 and T3
Correct answer: D. T2 and T3
A transaction must be rolled back if it read a value written by a transaction that is being rolled back. T2 read A from T1, so T2 goes. T3 read B from T2, so T3 goes as well - a cascade. T4 only wrote B without reading anything, so it depends on no one, and T5 read B after T4's write, so it saw T4's value, not T2's. T4 and T5 survive. Rolling back T5 confuses 'read the item B' with 'read T2's version of B'.
More DBMS and SQL questions
- A lock manager grants a request whenever it is compatible with the locks currently held; otherwise the requester waits. The requests…
- Transactions T1, T2 and T3 have timestamps 1, 2 and 3. All read and write timestamps of items A and C are initially 0, and the operations…
- A B+ tree uses 4096-byte blocks, 12-byte search keys, 8-byte block pointers and 10-byte record pointers. An internal node with p child…
- A B+ tree holds 10,000 keys in its leaves. A leaf holds at most 20 and at least 10 keys; an internal node has at most 30 and at least 15…
- A file has 200,000 fixed-length records of 200 bytes stored unspanned in 1024-byte blocks. A secondary index is built on a non-ordering…
- Relations R (1000 blocks) and S (200 blocks) are joined with a block nested-loop join using M = 52 buffer blocks: M - 2 blocks hold a…