Problem Statement
Contrast Snapshot Isolation with true Serializable isolation. When does Snapshot still allow anomalies?
Explanation
Snapshot Isolation lets readers see a stable, committed snapshot and resolves write conflicts when two transactions update the same row. It removes most read-write blocking and avoids many anomalies seen at Read Committed.
However, Snapshot can allow write skew: two transactions read overlapping sets and make disjoint writes that break a cross-row invariant. Serializable adds predicate-level protection or conflict detection to prevent these phantoms and write skew at higher cost.
Code Solution
SolutionRead Only
-- Example invariant: at least one doctor on call -- T1 sets A off call, T2 sets B off call; both read 'someone is on call' -> write skew
Practice Sets
This question appears in the following practice sets:
