Question
Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable?
| Transaction T1 | Transaction T2 |
|---|---|
| R1(X) | W2(X) |
| W1(Y) | W2(Y) |
| R1(X) | COMMIT(T2) |
| W1(X) | |
| COMMIT(T1) |
Official answer and solution
- Official answer
- B
- From
- Official GATE 2025 answer key
Solution
Build the precedence (conflict) graph for each schedule and check whether it is acyclic.
Checking conflicting operations on X and Y in each schedule:
- (A):
R1(X)precedesW2(X)(), whileW2(X)precedesR1(X)andW1(X)(). Cycle (not conflict serializable). - (B): On
X,W2(X)precedesR1(X), R1(X), W1(X)(); onY,W2(Y)precedesW1(Y)(). The precedence graph has only the edge and no cycle, so (B) is conflict serializable (equivalent to serial schedule ). - (C):
R1(X)precedesW2(X)(), whileW2(X)precedesR1(X)andW1(X)(). Cycle . - (D):
W2(X)precedesR1(X)(), whileW1(Y)precedesW2(Y)(). Cycle .
Final answer
Option (B)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 53 of 65
- 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.