Skip to content
Commitwise
Menu

Isolation level

How much a transaction is protected from seeing other transactions' concurrent changes.

Definition

The SQL standard defines Read Uncommitted, Read Committed, Repeatable Read and Serializable, by which anomalies they prevent: dirty reads, non-repeatable reads, phantoms. Real databases differ: PostgreSQL defaults to Read Committed and its Repeatable Read is snapshot isolation; MySQL InnoDB defaults to Repeatable Read. Stricter levels can abort a transaction with a serialization error that the app must retry.

In practice

A report runs several queries in one REPEATABLE READ transaction so all of them see the same snapshot.

Related terms

Esc

Type to search the whole site.