- Get link
- X
- Other Apps
A schedule of three database transactions T1, T2, and T3 is shown. Ri(A) and Wi(A) denote read and write of data item A by transaction Ti, i = 1,2,3. The transaction T1 aborts at the end. Which other transaction(s) will be required to be rolled back?
R1(X) W1(Y) R2(X) R2(Y) R3(Y) ABORT(T1)
The correct answer is option (C) Both T2 and T3.
This situation requires a cascading rollback. Transaction T1 writes to data item Y (W1(Y)). Subsequently, both T2 (with R2(Y)) and T3 (with R3(Y)) read the value of Y written by T1. Since T1 has not committed, this is a "dirty read." When T1 aborts, the value it wrote to Y is invalidated. Therefore, any transaction that read this dirty value must also be rolled back to maintain database consistency. Both T2 and T3 are dependent on T1 and must be rolled back.
This question tests the concept of recoverability in database schedules, specifically focusing on cascading rollbacks which occur due to dirty reads.
Step 1: Understand Dirty Read and Cascading Rollback
- Dirty Read: A transaction is said to perform a "dirty read" when it reads a data item that has been modified (written) by another transaction that has not yet committed. If the writing transaction later aborts, the data read by the first transaction becomes invalid.
- Cascading Rollback: If a transaction T1 aborts, and another transaction T2 had performed a dirty read on data from T1, then T2 must also be rolled back. This can create a chain reaction, or "cascade," where the rollback of one transaction forces others to roll back as well. [1, 4]
Step 2: Analyze the Transaction Schedule and Dependencies
Let's trace the operations and identify the dependencies between the transactions.
R1(X): T1 reads X.W1(Y): T1 writes a new value to Y. At this point, T1 is uncommitted.R2(X): T2 reads X. This is not a dirty read, as X was not written by an uncommitted transaction in this schedule.R2(Y): T2 reads Y. Since T1 wrote to Y and has not yet committed, T2 has performed a dirty read. T2 is now dependent on T1.R3(Y): T3 also reads Y. It reads the same value written by the uncommitted transaction T1. Therefore, T3 has also performed a dirty read and is dependent on T1.ABORT(T1): Transaction T1 fails and is rolled back.
Step 3: Determine which transactions must be rolled back
Because T1 aborts, all its operations are undone. The value it wrote to Y is now considered invalid. Any transaction that used this invalid data must also be rolled back to ensure the database remains in a consistent state.
- Transaction T2: It read the dirty value of Y from T1. Therefore, T2 must be rolled back.
- Transaction T3: It also read the dirty value of Y from T1. Therefore, T3 must be rolled back.
Both T2 and T3 are affected by the failure of T1 and must be part of the cascading rollback.
[1] Tutorialspoint. (2022). "Different Types of Recoverability of Schedules in DBMS."
[2] GeeksforGeeks. (2025). "Types of Schedules Based on Recoverability in DBMS."
[3] "Transaction Management Schedules," Course Notes.
[4] Gate Vidyalay. "Cascading Rollback | Cascadeless Schedule."
[5] "ACR schedules: Avoiding Cascading Rollback," Course Notes.
- Get link
- X
- Other Apps
Comments
Post a Comment
Ask you doubt here