Example – Serializable execution
•
•
ClearOut(p1,s1)
MakeSale(p1,s2,20)
•
Query InStore: qty is 30
•
update row 2: 45->25
•
find sum: 65
•
no order for p1 yet
•
Add 30 to WarehouseQty: 10->40
•
Update row 1, setting it to 0
•
COMMIT
•
Insert order for p1
•
COMMIT
•
etc
etc
etc
60
s1
p2
45
s2
p1
30
s1
p1
Initial state of InStore, Product, Order
Final state of InStore, Product, Order
Execution is like serial
MakeSale; ClearOut
etc
etc
etc
60
s1
p2
25
s2
p1
0
s1
p1
etc
etc
etc
44
etc
p2
10
etc
p1
etc
etc
etc
44
etc
p2
40
etc
p1
Order: empty
etc
Null
25
p1