Dynamic Databases
If we relax the assumption that the DB is a fixed collection of objects, even Strict 2PL will not assure serializability:
- T1 locks all pages containing sailor records with rating = 1, and finds oldest sailor (say, age = 71).
- Next, T2 inserts a new sailor; rating = 1, age = 96.
- T2 also deletes oldest sailor with rating = 2 (and, say, age = 80), and commits.
- T1 now locks all pages containing sailor records with rating = 2, and finds oldest (say, age = 63).
No consistent DB state where T1 is “correct”!