Question:medium

Let \( r_i(z) \) and \( w_i(z) \) denote read and write operations respectively on a data item \( z \) by a transaction \( T_i \). Consider the following two schedules. 
\[ \begin{aligned} S_1 &: r_1(x)\; r_1(y)\; r_2(x)\; r_2(y)\; w_2(y)\; w_1(x) \\ S_2 &: r_1(x)\; r_2(x)\; r_2(y)\; w_2(y)\; r_1(y)\; w_1(x) \end{aligned} \] Which one of the following options is correct?

Show Hint

A schedule is conflict serializable if and only if its precedence graph is acyclic.
Updated On: Jan 30, 2026
  • \(S_1\) is conflict serializable, and \(S_2\) is not conflict serializable.
  • \(S_1\) is not conflict serializable, and \(S_2\) is conflict serializable.
  • Both \(S_1\) and \(S_2\) are conflict serializable.
  • Neither \(S_1\) nor \(S_2\) is conflict serializable.
Show Solution

The Correct Option is B

Solution and Explanation

Step 1: Examine conflicting operations in schedule S1.
In S1, conflicts occur on both data items x and y.

• On x: the read operation r2(x) occurs before the write operation w1(x), which introduces an edge T2 → T1 in the precedence graph.
• On y: the read operation r1(y) occurs before the write operation w2(y), giving an edge T1 → T2.


Step 2: Check for cycles in the precedence graph of S1.
The precedence graph contains the cycle:

T1 → T2 → T1

Since a cycle exists, S1 is not conflict serializable.


Step 3: Examine conflicting operations in schedule S2.
In S2, the conflicts are analyzed as follows:

• On x: operations r1(x) and w1(x) belong to the same transaction and do not create inter-transaction conflicts. The operation r2(x) does not violate serializability.
• On y: r2(y) and w2(y) occur before r1(y), resulting in a single edge T2 → T1.


Step 4: Check for cycles in the precedence graph of S2.
The precedence graph contains only one directional edge and no cycles.

Hence, S2 is equivalent to the serial order T2 → T1.


Final Conclusion:
Schedule S1 is not conflict serializable, while schedule S2 is conflict serializable.

Final Answer: (B)

Was this answer helpful?
0