IAE Academy

GATE 2025 CS1 Q.15: solution and answer

GATE 2025 · CS1Q.15 · 1 mark · MCQ

A schedule of three database transactions , , and is shown. and denote read and write of data item by transaction , . The transaction aborts at the end. Which other transaction(s) will be required to be rolled back?

  1. (A)

    Only

  2. (B)

    Only

  3. (C)

    Both and

  4. (D)

    Neither nor

See the question in the paper

Answer and solution

ANSWER

Both T2 and T3 must be rolled back (option C).

Official answer: CSource: Official answer key, GATE 2025 CS1 (IIT Roorkee)

  1. Write the schedule as one column per transaction, in time order:

  2. When a transaction aborts, every write it made is undone. Any other transaction that has read a value written by the aborted transaction (a dirty read) has used data that never officially existed, so it must also be rolled back.

  3. writes only . It never writes , so reads a value did not touch and causes no dependence.

  4. comes after and before aborts, so read the uncommitted value of written by . must be rolled back.

  5. also comes after and before the abort, so also read the uncommitted value of . must be rolled back too.

  6. Both rollbacks are cascaded from 's abort, because each of and read a value written by before finished. This schedule is therefore not cascadeless. (Neither nor has committed in the schedule shown, so they can still be rolled back, and no committed work is lost.)

  7. Answer: both and , option (C).

KEY IDEA

If a transaction aborts, every transaction that read data the aborted one wrote (a dirty read) must also be rolled back. This is a cascading rollback.

WATCH OUT FOR

Counting as a dependence, or rolling back only the first transaction that read . A read of an item the aborted transaction never wrote is harmless, but every read of after is dirty.

From the GATE 2025 CS1 paper. Every question of this paper · Download the full paper · All 9 Transactions questions, with notes

More Transactions questions