- We have 2 DB elements:
- We have 2 transactions:
- T1:
add 100 to
database elements
A and
B
- T2:
double the value of
database elements
A and
B
|
In code:
T1 T2
=================================
READ(A, t) READ(A, s)
t = t + 100 s = 2×s
WRITE(A, t) WRITE(A, s)
READ(B, t) READ(B, s)
t = t + 100 s = 2×s
WRITE(B, t) WRITE(B, s)
|
- Example of a
schedule:
// Blue: operations of T1
// Red: operations of T2
READ1(A, t)
READ2(A, s)
t = t + 100
s = 2×s
WRITE1(A, t)
WRITE2(A, s)
READ1(B, t)
t = t + 100
WRITE1(B, t)
READ2(B, s)
s = 2×s
WRITE2(B, t)
|
|