Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by and respectively. Which one of them is conflict serializable?
GATE CSE 2014Databases › Transactions, Concurrency Control & IndexingVerified
GATE CSE 2014 PYQ: Consider the following four schedules due to three transactions (indicated by the subscript) using read and…
- A; ; ; ; ;
- B; ; ; ; ;
- C; ; ; ; ;
- D; ; ; ; ;Correct answer
Answer
(D) r 2 ( x ) r_2(x) r 2 ( x ) ; w 2 ( x ) w_2(x) w 2 ( x ) ; r 3 ( x ) r_3(x) r 3 ( x ) ; r 1 ( x ) r_1(x) r 1 ( x ) ; w 1 ( x ) w_1(x) w 1 ( x ) ;
Approach
For each schedule, construct a precedence graph among transactions T1, T2, and T3. A conflict exists when two operations from different transactions access the same data item x and at least one is a write. Add an edge $T_i$ -> $T_j$ if a conflicting operation of $T_i$ precedes one of $T_j$. The schedule is conflict serializable exactly when the precedence graph has no cycle.
Only option D produces an acyclic precedence graph. The other schedules each contain a cycle between T1 and T2, so they are not conflict serializable.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.