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?
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)