GATE / CS ARCHIVE

GATE CSE 2014 SET 1 / QUESTION 29

GATE CSE 2014 Set 1 Q29

Database Management Systems · Transactions & Concurrency Control · Full GATE CSE 2014 Set 1 paper

GATE 2014 Set 1, Q29 2 marks · MCQ
Report issue

Transactions & Concurrency Control

Question 29, GATE 2014: On one item x, which schedule is conflict serializable? Subscripts identify transactions. A: r₁(x);r₂(x);w₁(x);r₃(x);w₂(x). B: r₂(x);r₁(x);w₂(x);r₃(x);w₁(x). C: r₃(x);r₂(x);r₁(x);w₂(x);w₁(x). D: r₂(x);w₂(x);r₃(x);r₁(x);w₁(x).
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Step through it (4 schedules)

1. Method and setup. Build a precedence graph with one vertex per transaction. Add an edge for time-ordered accesses by different transactions to x when at least one is a write; two reads alone create no conflict. The schedule is conflict serializable exactly when this graph is acyclic.

2. Work through the result and its assumptions. A and B each contain conflicting edges 1→2 and 2→1. C likewise has 1→2 from r1 before w2 and 2→1 from r2 before w1. D has edges 2→3, 2→1, 3→1 and no cycle, with serial order T2, T3, T1. Thus D.

Original paper, page 14 · Answer key