GATE / CS ARCHIVE

GATE CSE 2014 SET 3 / QUESTION 29

GATE CSE 2014 Set 3 Q29

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

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

Transactions & Concurrency Control

Question 29, GATE 2014: Transactions are T1:r1(X),r1(Z),w1(X),w1(Z); T2:r2(Y),r2(Z),w2(Z); T3:r3(Y),r3(X),w3(Y). S1=r1(X),r3(Y),r3(X),r2(Y),r2(Z),w3(Y),w2(Z),r1(Z),w1(X),w1(Z). S2=r1(X),r3(Y),r2(Y),r3(X),r1(Z),r2(Z),w3(Y),w1(X),w2(Z),w1(Z). Which schedules are conflict-serializable? A only S1; B only S2; C both; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (2 schedules)

Step 1: Construct a precedence graph: add Ti→Tj when conflicting operations from different transactions access the same item, at least one is a write, and Ti's operation occurs first. Read/read pairs create no edge. Step 2: In S1, Y gives T2→T3, X gives T3→T1, and Z gives T2→T1. The graph is acyclic, with serial order T2,T3,T1. Step 3: In S2, r1(Z) precedes w2(Z), giving T1→T2; r2(Z) and w2(Z) precede w1(Z), giving T2→T1. This two-way cycle suffices to reject conflict serializability. Thus only S1 is conflict-serializable, A.

Original paper, page 59 · Answer key