Skip to content
Official PYQ · 2025

GATE CS 2025 Set 1 Q5 — Transactions and Concurrency Control

Explain with AI

A schedule of three database transactions T1,T2T_{1}, T_{2}, and T3T_{3} is shown. Ri(A)R_{i}(A) and Wi(A)W_{i}(A) denote read and write of data item AA by transaction Ti,i=1,2,3T_{i}, i=1,2,3. The transaction T1T_{1} 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)R_{1}(X) W_{1}(Y) R_{2}(X) R_{2}(Y) R_{3}(Y) \operatorname{ABORT}\left(T_{1}\right)

Choose one option
View worked solution

Answer: C

To determine which transactions must be rolled back when T1T_1 aborts, we need to identify any dirty reads (reading uncommitted data written by an active transaction).

Let's analyze the sequence of operations in the given schedule:

  1. R1(X)R_1(X): T1T_1 reads XX.
  2. W1(Y)W_1(Y): T1T_1 writes to YY.
  3. R2(X)R_2(X): T2T_2 reads XX.
  4. R2(Y)R_2(Y): T2T_2 reads YY. Since T1T_1 has written YY but has not committed yet, this is a dirty read. T2T_2 is now dependent on T1T_1.
  5. R3(Y)R_3(Y): T3T_3 reads YY. This is also a dirty read of the uncommitted value written by T1T_1. T3T_3 is now dependent on T1T_1.
  6. ABORT⁡(T1)\operatorname{ABORT}(T_1): T1T_1 aborts.

Because T1T_1 aborts, any transaction that read uncommitted data written by T1T_1 must also be rolled back to prevent cascading inconsistency (cascading rollback).

  • Since T2T_2 read YY from T1T_1, T2T_2 must be rolled back.
  • Since T3T_3 read YY from T1T_1, T3T_3 must be rolled back.

Therefore, both T2T_2 and T3T_3 are required to be rolled back.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Transactions and Concurrency Control questions