written 8.0 years ago by | modified 2.9 years ago by |
Mumbai University > Information Technology > Sem 3 > Database Management System
Marks: 10M
Year: May 2014
written 8.0 years ago by | modified 2.9 years ago by |
Mumbai University > Information Technology > Sem 3 > Database Management System
Marks: 10M
Year: May 2014
written 8.0 years ago by |
To check for conflict serializability takes two steps.
Step 1: Check for the conflicting actions
Two or more actions are said to be in conflict if:
The actions access the same object (read or write).
The following set of actions is conflicting:
T1:R(X), T2:W(X), T3:W(X)
While the following sets of actions are not:
T1:R(X),T2:R(X),T3:R(X)
T1:R(X), T2:W(Y), T3:R(X)
For example, we have a conflict on X (T1 reads it and T2 writes it).
We also have a conflict on Y (T2 reads it and T3 writes it).
So it has a conflict property but is it serializable?
Step 2: Check for a cycle in the Precedence Graph
First, draw all the Transactions (Tx):
We also have T3 that writes Y after T2 reads it, so draw arrow from T2 -> T3
Check if there is a Tx that writes an item after a different TX writes it. So, the final graph is:
We can see that there is a cycle between T1 and T2, so the graph is cyclic, and therefore it is not conflict serializable.