Question:medium

Let \(S\) be the following schedule of operations of three transactions \(T_1, T_2\) and \(T_3\) in a relational database system:
\[ R_2(Y),\; R_1(X),\; R_3(Z),\; R_1(Y),\; W_1(X),\; R_2(Z),\; W_2(Y),\; R_3(X),\; W_3(Z) \] Consider the statements \(P\) and \(Q\) below:
\[ P:\ S \text{ is conflict-serializable.} \] \[ Q:\ \text{If } T_3 \text{ commits before } T_1 \text{ finishes, then } S \text{ is recoverable.} \] Which one of the following choices is correct?

Show Hint

Recoverability requires that a transaction must not commit before the transaction whose data it has read commits.
Updated On: Feb 2, 2026
  • Both \(P\) and \(Q\) are true.
  • \(P\) is true and \(Q\) is false.
  • \(P\) is false and \(Q\) is true.
  • Both \(P\) and \(Q\) are false.
Show Solution

The Correct Option is B

Solution and Explanation

To determine the correctness of the statements \(P\) and \(Q\), we need to analyze the schedule given for the operations of transactions \(T_1, T_2, T_3\).

The schedule provided is:

\(R_2(Y), R_1(X), R_3(Z), R_1(Y), W_1(X), R_2(Z), W_2(Y), R_3(X), W_3(Z)\)

Step 1: Conflict Serializability

For a schedule to be conflict-serializable, it must be possible to transform the schedule into a serial schedule by swapping non-conflicting operations.

Operations conflict if they are from different transactions, involve the same data item, and at least one of these operations is a write.

  • Reading Conflicts: These do not cause conflicts unless followed by a writing operation.
  • Write after Read (WAR), Write after Write (WAW), or Read after Write (RAW): All these can cause conflicts.

Let's analyze the conflicts:

  • \(R_2(Y)\) vs \(W_2(Y)\) (Same transaction, ignored) 
  • \(R_1(X)\) vs \(W_1(X)\) (Same transaction, ignored)
  • \(R_2(Z)\) vs \(W_3(Z)\) (Conflict between \(T_2\) and \(T_3\) due to write after read)
  • \(R_3(X)\) vs \(W_1(X)\) (Conflict between \(T_3\) and \(T_1\) due to read after write)
FromTo
\(T_3\)\(T_1\)
\(T_2\)\(T_3\)

Since the conflict graph has no cycles, the schedule is conflict-serializable. So, statement \(P\) is true.

Step 2: Recoverability

For a schedule to be recoverable, no transaction should commit before another transaction from which it has read data (and that data has been modified).

Let's analyze the condition given:

If \(T_3\) commits before \(T_1\) finishes:

  • \(T_3\) reads \(X\) written by \(T_1\) (\(R_3(X)\) after \(W_1(X)\))
  • If \(T_3\) commits before \(T_1\), then it leads to a non-recoverable schedule because \(T_3\) has read \(X\) from \(T_1\), which hasn't yet committed.

This makes the schedule non-recoverable if \(T_3\) commits before \(T_1\) finishes. Thus, statement \(Q\) is false.

Conclusion

Therefore, the correct answer is that \(P\) is true and \(Q\) is false.

Was this answer helpful?
0