Skip to content
Official PYQ · 2025

GATE CS 2025 Set 2 Q43 — Transactions and Concurrency Control

Explain with AI

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}

Choose one option
View worked solution

Answer: B

To determine which schedule is conflict serializable, we construct the precedence graph for each option. An edge Ti→TjT_i \to T_j exists if there is a pair of conflicting operations (on the same data item, with at least one write) such that TiT_i executes before TjT_j.

Let's analyze the schedules:

  • Option A:
    • R1(X)R_1(X) occurs before W2(X)  ⟹  T1→T2W_2(X) \implies T_1 \to T_2
    • W2(X)W_2(X) occurs before R1(X)  ⟹  T2→T1R_1(X) \implies T_2 \to T_1
    • This creates a cycle T1⇌T2T_1 \rightleftharpoons T_2. Thus, it is not conflict serializable.
  • Option B:
    • W2(X)W_2(X) occurs before R1(X)R_1(X) and W1(X)  ⟹  T2→T1W_1(X) \implies T_2 \to T_1
    • W2(Y)W_2(Y) occurs before W1(Y)  ⟹  T2→T1W_1(Y) \implies T_2 \to T_1
    • There are no conflicting operations where T1T_1 executes before T2T_2. The precedence graph contains only the edge T2→T1T_2 \to T_1, which is acyclic. Thus, it is conflict serializable.
  • Option C:
    • R1(X)R_1(X) occurs before W2(X)  ⟹  T1→T2W_2(X) \implies T_1 \to T_2
    • W2(X)W_2(X) occurs before R1(X)  ⟹  T2→T1R_1(X) \implies T_2 \to T_1
    • This creates a cycle T1⇌T2T_1 \rightleftharpoons T_2. Thus, it is not conflict serializable.
  • Option D:
    • W1(Y)W_1(Y) occurs before W2(Y)  ⟹  T1→T2W_2(Y) \implies T_1 \to T_2
    • W2(X)W_2(X) occurs before R1(X)  ⟹  T2→T1R_1(X) \implies T_2 \to T_1
    • This creates a cycle T1⇌T2T_1 \rightleftharpoons T_2. Thus, it is not conflict serializable.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Transactions and Concurrency Control questions