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 )\)
- A.
OnlyΒ
\(π_2\) - B.
OnlyΒ
\(π_3\) - C.
BothΒ
\(π_2\)andΒ\(π_3\) - 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.