The GATE Grind

GATE 2025 CS (CS2) – Question 53

Databases · Transactions and Concurrency Control · 2 marks · Multiple select

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

Transaction T1: R1(X), W1(Y), R1(X), W1(X), COMMIT(T1)
Transaction T2: W2(X), W2(Y), COMMIT(T2)

  1. R1(X), W2(X), W1(Y), W2(Y), R1(X), W1(X), COMMIT(T2), COMMIT(T1)
  2. W2(X), R1(X), W2(Y), W1(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1)
  3. R1(X), W1(Y), W2(X), W2(Y), R1(X), W1(X), COMMIT(T1), COMMIT(T2)
  4. W2(X), R1(X), W1(Y), W2(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1)

Practise this question in The GATE Grind →

Show answer and explanation

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

Explanation

Schedules of $T_1$: $R_1(X),W_1(Y),R_1(X),W_1(X)$; $T_2$: $W_2(X),W_2(Y)$.

Conflicts exist on $X$ and $Y$ between $T_1$ and $T_2$. Draw the precedence graph ($T_a\to T_b$ if a conflicting operation of $T_a$ precedes one of $T_b$).

Answer: B.

More Transactions and Concurrency Control questions

All Transactions and Concurrency Control questions →