Skip to main content

GATE CSE 2025Databases › Transactions, Concurrency Control & IndexingVerified

GATE CSE 2025 PYQ: Consider the database transactions T1 and T2 , and data items X and Y . Which of the schedule(s) is/are…

Consider the database transactions T1 and T2 , and data items X and Y . Which of the schedule(s) is/are conflict serializable?

Transaction T1R1(X)W1(Y)R1(X)W1(X)COMMIT(T1)Transaction T2W2(X)W2(Y)COMMIT(T2)\begin{array}{|ll|} \hline \textbf{Transaction T1} \\ \text{R1(X)} \\ \text{W1(Y)} \\ \text{R1(X)} \\ \text{W1(X)} \\ \text{COMMIT(T1)} \\\hline \end{array} \quad \begin{array}{|ll|} \hline \textbf{Transaction T2} \\ \text{W2(X)} \\ \text{W2(Y)} \\ \text{COMMIT(T2)} \\\hline \end{array}

  1. A
    R1(X), W2(X), W1(Y), W2(Y), R1(X), W1(X), COMMIT(T2), COMMIT(T1)
  2. B
    W2(X), R1(X), W2(Y), W1(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1)
    Correct answer
  3. C
    R1(X), W1(Y), W2(X), W2(Y), R1(X), W1(X), COMMIT(T1), COMMIT(T2)
  4. D
    W2(X), R1(X), W1(Y), W2(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1)

     

Answer

(B) W2(X), R1(X), W2(Y), W1(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1)

Approach

Build a precedence graph for each schedule: add edge Ti → Tj whenever an operation of Ti precedes a conflicting operation of Tj (same data item, at least one write). A schedule is conflict serializable iff this graph has no cycle.

Only option B produces an acyclic precedence graph, so only B is conflict serializable. The community answers agree with this result.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.