Comparison
Dirty readvsNon-repeatable read
Dirty read
you read a value another transaction had written but not committed, and then it rolled back and the value never existed.
Seeing uncommitted state from a concurrent transaction. Almost every database prevents it by default, so it is mostly an interview term — but it is the anomaly people mean when they say a level is "unsafe", and it is the baseline the other anomalies are defined against.
Full entry →Non-repeatable read
you read the row at the start of the transaction, read it again at the end, and it has a different value because somebody committed in between.
The same row returning different values within one transaction. It is permitted at read committed and prevented at repeatable read. It bites in report generation and in any multi-step calculation, where two halves of the same answer are computed against different states of the world.
Full entry →