Serializability
Serializability
As transactions execute concurrently, we must guarantee isolation, i.e., we only want to allow good schedules. Good schedules, or rather, schedules that guarantee isolation, means that the resulting schedules are equivalent to some serial schedule. Any schedule that is conict serializable is equivalent to some serial schedule. Any schedule that is view serializable is equivalent to some serial schedule. Schedules exist which are neither view nor conict serializable, but are equivalent to some serial schedule. Schedules exist which are view serializable but not conict serializable. Concurrency control schemes/algorithms are required that ensure either conict or view serializability.
2. Remove all the edges incident on useless transactions. A transaction Ti is useless if there exists no path, in the precedence graph, from Ti to transaction Tf. 3. For each data item Q such that Tj reads the value of Q written by Ti, and Tk executes write(Q) and T k T b , do the following: a) If T i = T b and T j T f , then insert the edge
0 in the labeled precedence graph. T j Tk 0 in the labeled precedence graph. Tk Ti p p and in the labeled precedence graph Tk Ti T j Tk
where p is a unique integer larger than 0 that has not been used earlier for labeling edges.
- Rule 3a) ensures that if a transaction reads an initial value of Q in schedule S, then it also reads that same value in any view-equivalent schedule. - Rule 3b) ensures that if a transaction writes the nal value of Q in schedule S, then it also writes that same value in any view-equivalent schedule. - Rule 3c) ensures that if a transaction Ti writes a data item that Tj reads, then any transaction Tk that writes the same data item must either come before Ti or after Tj in any view-equivalent schedule.
T3 0 0 T4 0 0 T7 Tf 1 0 0
T3 0 T4 1 Tf 0 T7
Tb
Tb
Tb 0 T9 T8 T10 0 0 0 T7 0 1 T4 T3
Tb
T3
0 0 1 T8 2 0 2 0 T10 0 Tf 0
T9 0
T4 0 T7
Tf