Professional Documents
Culture Documents
04 Chapter 17 Transaction Processing Concepts
04 Chapter 17 Transaction Processing Concepts
04 Chapter 17 Transaction Processing Concepts
Chapter 17
B B B
CPU2
A A
CPU1 A
CPU1
time
t1 t2 t1 t2
Interleaved processing Parallel processing
(Single processor) (Two or more processors)
t0 read_item(X);
read_item(Y);
X:=X - 400000;
Y:=Y + 400000;
write _item(X);
tk write_item(Y);
• A schedule, S:
r1(X); r2(X); w1(X); r1(Y); w2(X); w1(Y); c1; c2
conflicts
S1 S2
read_item(X); read_item(X);
X:=X+10; X:=X*1.1;
write_item(X); write_item(X);
Schedules S1 and S2 are result equivalent for X=100 but not in general
X,Y
T1 T2
Y Y,Z
no cycles S is serializable
T3 Equivalent Serial Schedule:
T3 T1 T2
(precedence order)
ICS 424 - 01 (072) Transaction Processing Concepts 47
and Theory
Characterizing Schedules based on
Serializability
• Being serializable is not the same as being serial
• Being serializable implies that the schedule is a
correct schedule.
• It will leave the database in a consistent state.
• The interleaving is appropriate and will result in a
state as if the transactions were serially executed, yet
will achieve efficiency due to concurrent execution.
• View serializability
• Definition of serializability based on view equivalence.
A schedule is view serializable if it is view equivalent to a
serial schedule.
In Sa, the operations w2(X) and w3(X) are blind writes, since T1 and T3 do
not read the value of X.
READ
COMMITTED No Yes Yes
REPEATABLE
READ No No Yes
SERIALIZABLE No No No
Thank you