Example – Inconsistent read
•
•
ClearOut(p1,s1)
MakeSale(p1,s2,60)
•
Query InStore: qty is 30
•
Add 30 to WarehouseQty: 10->40
•
update row 2: 65->5
•
find sum: 75
•
// no need to insert
•
// row in Order
•
Update row 1, setting it to 0
•
COMMIT
•
COMMIT
•
etc
etc
etc
60
s1
p2
65
s2
p1
30
s1
p1
Initial state of InStore, Product
Final state of InStore, Product
Integrity constraint is false:
Sum for p1 is only 45!
etc
etc
etc
60
s1
p2
5
s2
p1
0
s1
p1
etc
etc
etc
44
etc
p2
10
etc
p1
etc
etc
etc
44
etc
p2
40
etc
p1