Timestamp-based Optimistic Concurrency Control
Data items are tagged with read-time and write-time.
1. Transaction cannot read value of item if that value has not been written until after the transaction executed.
Transaction with T.S. t1 cannot read item with write-time t2 if t2 > t1.
(abort and try with new timestamp)
2. Transaction cannot write item if item has value read at later time.
Transaction with T.S. t1 cannot write item with read-time t2 if t2 > t1.
(abort and try with new timestamp)
Other possible conflicts:
- Two transactions can read the same item at different times.
- What about transaction with T.S. t1 that wants to write to item with write-time t2 and t2>t1?