Example – No Lost update
•
•ClearOut(p1,s1)        AcceptReturn(p1,s1,60)
•Query InStore; qty is 25
•//t1 R-lock InStore.row1
•Add 25 to WarehouseQty: 40->65
•// t1 W-lock Product.row 1
•                     try Update row 1
•                   // blocked
•                   // as W-lock on InStore.row1
•                   // can’t be obtained
•Update row 1, setting it to 0
•//t1 upgrades to W-lock on InStore.row1
•COMMIT // release t1’s locks
•                          // now get W-lock
•                          Update row 1: 0->60
•                          COMMIT
Initial state of InStore, Product
Final state of InStore, Product
Outcome is same as serial
ClearOut; AcceptReturn
etc
etc
etc
45
s1
p2
50
s2
p1
25
s1
p1
etc
etc
etc
45
s1
p2
50
s2
p1
60
s1
p1
etc
etc
etc
55
etc
p2
40
etc
p1
etc
etc
etc
55
etc
p2
65
etc
p1