Phantom Problem

What
The phantom problem occurs when we start to talk about concurrently executing insertions and deletes along with the read and writes. Even when using strict 2PL, we are not guaranteed serializability.



Oldest Sailor
Observing the graphic to the right, we see that there's no possible serial execution of the two transactions that will give us the result that we get (The oldest sailor changes in between the actions in T1)
 * 1) T1 locks all sailor records and finds the oldest sailor (say age = 71)
 * 2) T2 inserts a new sailor record with age 96
 * 3) T1 checks the sailor table again and finds that the oldest sailor is now 96.

Problem
The underlying problem is that conflict serializability on reads and write guarantees serializibility only if the set of objects is fixed.

Solution

 * Index Key Value Locking