A schedule of three database transactions \(𝑇_1, 𝑇_2\), and \(𝑇_3\) is…

2025

A schedule of three database transactions \(𝑇_1, 𝑇_2\), andΒ \(𝑇_3\) is shown.Β \(𝑅_𝑖(𝐴)\) andΒ \(π‘Š_𝑖(𝐴)\) denote read and write of data itemΒ \(𝐴\) by transaction \(𝑇_𝑖 , 𝑖 = 1,2,3\). The transactionΒ \(𝑇_1\) aborts at the end. Which other transaction(s) will be required to be rolled back?

\(𝑅_1 (𝑋) π‘Š_1 (π‘Œ) 𝑅_2 (𝑋) 𝑅_2 (π‘Œ) 𝑅_3 (π‘Œ) 𝐴𝐡𝑂𝑅𝑇(𝑇_1 )\)

  1. A.

    OnlyΒ \(𝑇_2\)

  2. B.

    OnlyΒ \(𝑇_3\)

  3. C.

    BothΒ \(𝑇_2\) andΒ \(𝑇_3\)

  4. D.

    NeitherΒ \(𝑇_2\) norΒ \(𝑇_3\)

Attempted by 248 students.

Show answer & explanation

Correct answer: C

Answer: Both transactions T2 and T3 must be rolled back.

Explanation:

  • Identify the relevant operations in order: T1 writes Y (W1(Y)) occurs before the reads R2(Y) and R3(Y).

  • If a transaction aborts, any transaction that has read a value written by that aborted transaction must be rolled back to prevent cascading inconsistency (they read an uncommitted value).

  • Both T2 and T3 read Y after W1(Y), so they both read a value produced by T1. Therefore both T2 and T3 must be rolled back when T1 aborts.

  • Note: T2's read of X is unaffected because T1 did not write X; only reads of the aborted transaction's writes force rollbacks.

A video solution is available for this question β€” log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir