Discussion
A schedule of three database transactions \(T_{1}\), \(T_{2}\), and \(T_{3}\) is shown. \(R_{i}(A)\) and \(W_{i}(A)\) denote read and write of data item \(A\) by transaction \(T_{i}\), \(i = 1,2,3\). The transaction \(T_{1}\) aborts at the end. Which other transaction(s) will be required to be rolled back?
\(R_{1}(X)\ W_{1}(Y)\ R_{2}(X)\ R_{2}(Y)\ R_{3}(Y)\ ABORT(T_{1})\)
Answer: C
The transactions to roll back are Both \(T_{2}\) and \(T_{3}\).
\(T_{1}\) writes Y, and then \(T_{2}\) reads Y and \(T_{3}\) reads Y before \(T_{1}\) finishes. Both have read a value written by an uncommitted transaction (a dirty read). When \(T_{1}\) aborts, its write to Y is undone, so the values \(T_{2}\) and \(T_{3}\) read never officially existed and both must be rolled back too: a cascading rollback.
\(T_{2}\)'s read of X does not matter, because \(T_{1}\) only read X and did not write it. Since each of \(T_{2}\) and \(T_{3}\) depends on \(T_{1}\)'s write of Y, 'only one of them' and 'neither' are both wrong.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development