Question

Consider the following partial Schedule SS involving two transactions T1T1 and T2T2. Only the read and the write operations have been shown. The read operation on data item PP is denoted by read(P)\text{read}(P) and the write operation on data item PP is denoted by write(P)\text{write}(P).

Time instanceT1T2
1read(A)
2write(A)
3read(C)
4write(C)
5read(B)
6write(B)
7read(A)
8commit
9read(B)

Suppose that the transaction T1T1 fails immediately after time instance 9. Which one of the following statements is correct?

Choose one option
Official answer and solution
Official answer
B
From
Official GATE 2015 answer key

Solution

Inspect the schedule for uncommitted reads and the commit ordering of participating transactions.

Examine the operations in Schedule SS:

  • Time 2: T1T1 writes to data item AA (write(A)).
  • Time 7: T2T2 reads data item AA (read(A)), which was modified by T1T1.
    This is a dirty read because T1T1 has not yet committed.
  • Time 8: T2T2 commits (commit).
  • Time 9: T1T1 reads data item BB.
  • After time 9: T1T1 fails.

A schedule is recoverable if and only if, whenever a transaction TjT_j reads a value written by TiT_i, TiT_i commits before TjT_j commits.

Here, T2T2 reads AA written by T1T1 and commits at time 8, while T1T1 has not committed and subsequently fails after time 9.
Because T2T2 has already committed, its effects are durable (ACID Durability) and it cannot be rolled back or aborted.
Consequently, transaction atomicity for T1T1 cannot be maintained without violating T2T2's durability.

Therefore, Schedule SS is non-recoverable and cannot ensure transaction atomicity (Option B).

Final answer

B

Common trap

Believing T2 can simply be aborted, forgetting that once a transaction commits (time 8), DBMS durability rules forbid aborting or rolling it back.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 3
Question
39 of 65, printed as CS Q.29
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.