Question
Consider the following partial Schedule involving two transactions and . Only the read and the write operations have been shown. The read operation on data item is denoted by and the write operation on data item is denoted by .
| Time instance | T1 | T2 |
|---|---|---|
| 1 | read(A) | |
| 2 | write(A) | |
| 3 | read(C) | |
| 4 | write(C) | |
| 5 | read(B) | |
| 6 | write(B) | |
| 7 | read(A) | |
| 8 | commit | |
| 9 | read(B) |
Suppose that the transaction fails immediately after time instance 9. Which one of the following statements is correct?
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 :
- Time 2: writes to data item (
write(A)). - Time 7: reads data item (
read(A)), which was modified by .
This is a dirty read because has not yet committed. - Time 8: commits (
commit). - Time 9: reads data item .
- After time 9: fails.
A schedule is recoverable if and only if, whenever a transaction reads a value written by , commits before commits.
Here, reads written by and commits at time 8, while has not committed and subsequently fails after time 9.
Because has already committed, its effects are durable (ACID Durability) and it cannot be rolled back or aborted.
Consequently, transaction atomicity for cannot be maintained without violating 's durability.
Therefore, Schedule is non-recoverable and cannot ensure transaction atomicity (Option B).
B
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.