Transaction Anomalies and Isolation Contracts
Translate an isolation claim into allowed histories and distinguish repeated-read changes from invalid combined updates.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
A history records what each transaction observed
A nonrepeatable read occurs when two reads of the same row within one transaction can observe different committed values. A phantom involves a changing set satisfying a predicate, such as a count of available seats after another transaction inserts one. A dirty read observes uncommitted work and can expose values later rolled back. Which histories are allowed depends on the database’s actual isolation rules.
An application invariant can relate several rows
A workflow may require at least one reviewer to remain assigned. Each of two transactions can observe both reviewers and remove a different one, even though the combination violates the rule under a model allowing that history. Testing one row’s changes does not cover such relationships. Snapshot isolation explains why consistent individual views can coexist with write skew. Conflict serializability provides one way to reason about equivalent serial order.[1][2]