GATE / CS ARCHIVE

GATE CSE 2021 SET 2 / QUESTION 32

GATE CSE 2021 Set 2 Q32

Database Management Systems · Transactions & Concurrency Control · Full GATE CSE 2021 Set 2 paper

GATE 2021 Set 2, Q32 2 marks · MCQ
Report issue

Transactions & Concurrency Control

Question 32, GATE 2021: Schedule R1(Y),R1(X),R2(Z),R1(Y),W1(X),R2(Z),W2(Y),R3(X),W3(Z). P: conflict-serializable. Q: if T3 commits before T1 finishes, schedule is recoverable. A both; B only P; C only Q; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (2 schedules)

On Y, R1(Y) precedes W2(Y), giving T1→T2. On X, W1(X) precedes R3(X), giving T1→T3. On Z, R2(Z) precedes W3(Z), giving T2→T3. This acyclic graph has serial orderT1, T2, T3, so P is true. T3 reads X written by T1; committing T3 before T1 finishes violates recoverability. Hence Q is false and B holds.

Conflicts require the same data item, distinct transactions, and at least one write. Repeated reads of Z do not introduce a reverse edge. Serializability and recoverability are distinct: an acyclic precedence graph controls equivalent ordering of operations, whereas a reads-from dependency requires the writer to commit before its reader commits.

Original paper, page 73 · Answer key