The GATE Grind

GATE 2021 CS (CS2) – Question 42

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

Schedule S is R2(Y),R1(X),R3(Z),R1(Y),W1(X),R2(Z),W2(Y),R3(X),W3(Z). P: S is conflict-serializable. Q: If T3 commits before T1 finishes, S is recoverable. Choose the truth values.

  1. Both true
  2. P true,Q false
  3. P false,Q true
  4. Both false

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) P true,Q false

Explanation

Conflicts on Y give T1→T2 because R1(Y) precedes W2(Y). On X, W1(X) precedes R3(X), giving T1→T3. On Z, R2(Z) precedes W3(Z), giving T2→T3. The graph is acyclic, with order T1,T2,T3, so P is true. T3 reads X from T1; committing T3 before T1 violates recoverability. Thus Q is false, B.

More Transactions and Concurrency Control questions

All Transactions and Concurrency Control questions →