Assumptions
Two-phase locking
- Set a lock before accessing a data item
- Get all locks before releasing any of them
- Implies transactions execute serializably
Hold write locks until after a transaction commits. Implies:
- Recoverability – Transaction T1 commits after all transactions that T read from, to avoid this: w2[x] r1[x] commit(T1) abort(T2)
- No cascading aborts – T1 doesn’t read dirty (uncommitted) data. Avoids w2[x] r1[x] abort(T2), which implies abort(T1).
- Strictness – Don’t overwrite uncommitted data, so abort can be implemented by restoring before images. Avoids this:w2[x] w1[x] abort(T2) … can’t restore before-image of w2[x]!?