Question
Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below.
T1: r1(X); r1(Z); w1(X); w1(Z)
T2: r2(Y); r2(Z); w2(Z)
T3: r3(Y); r3(X); w3(Y)
S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z)
S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
Which one of the following statements about the schedules is TRUE?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2014 answer key
Solution
Construct the precedence (serialization) graph for each schedule and check for directed cycles.
-
Transactions:
-
Precedence Graph for Schedule :
- On item : occurs before .
- On item : occurs before .
- On item : occurs before and .
The edges are , , and . This directed graph is acyclic (topological ordering: ).
Hence, is conflict-serializable.
-
Precedence Graph for Schedule :
- On item :
- occurs before .
- occurs before .
This creates a direct 2-cycle: .
Because the precedence graph contains a cycle, is NOT conflict-serializable.
- On item :
-
Therefore, only is conflict-serializable (option A).
A
Missing the conflict between r1(Z) and w2(Z) that creates an edge T1 -> T2 in S2.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 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.