Question

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

Transaction T1Transaction T2
R1(X)W2(X)
W1(Y)W2(Y)
R1(X)COMMIT(T2)
W1(X)
COMMIT(T1)
Choose every correct option
Official answer and solution
Official answer
B
From
Official GATE 2025 answer key

Solution

Build the precedence (conflict) graph for each schedule and check whether it is acyclic.

Checking conflicting operations on X and Y in each schedule:

  • (A): R1(X) precedes W2(X) (T1→T2T_1 \rightarrow T_2), while W2(X) precedes R1(X) and W1(X) (T2→T1T_2 \rightarrow T_1). Cycle T1↔T2T_1 \leftrightarrow T_2 (not conflict serializable).
  • (B): On X, W2(X) precedes R1(X), R1(X), W1(X) (T2→T1T_2 \rightarrow T_1); on Y, W2(Y) precedes W1(Y) (T2→T1T_2 \rightarrow T_1). The precedence graph has only the edge T2→T1T_2 \rightarrow T_1 and no cycle, so (B) is conflict serializable (equivalent to serial schedule T2→T1T_2 \rightarrow T_1).
  • (C): R1(X) precedes W2(X) (T1→T2T_1 \rightarrow T_2), while W2(X) precedes R1(X) and W1(X) (T2→T1T_2 \rightarrow T_1). Cycle T1↔T2T_1 \leftrightarrow T_2.
  • (D): W2(X) precedes R1(X) (T2→T1T_2 \rightarrow T_1), while W1(Y) precedes W2(Y) (T1→T2T_1 \rightarrow T_2). Cycle T1↔T2T_1 \leftrightarrow T_2.
Final answer

Option (B)

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2025 Computer Science and Information Technology - Session 2 (CS2)
Question
53 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.