on dev help sign in
isolation level docs
92615d8Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Transaction.hs+6−13
@@ -120,25 +120,18 @@ renderTransactionMode mode =
120-- between concurrent transactions, which must not occur at each level.
120-- between concurrent transactions, which must not occur at each level.
121-- The phenomena which are prohibited at various levels are:
121-- The phenomena which are prohibited at various levels are:
122--
122--
123−-- __Dirty read__
123+-- __Dirty read__: A transaction reads data written by a concurrent uncommitted transaction.
124--
124--
125−-- A transaction reads data written by a concurrent uncommitted transaction.
126−--
127−-- __Nonrepeatable read__
128−--
129−-- A transaction re-reads data it has previously read and finds that data
125+-- __Nonrepeatable read__: A transaction re-reads data it has previously read and finds that data
130-- has been modified by another transaction (that committed since the initial read).
126-- has been modified by another transaction (that committed since the initial read).
131--
127--
132−-- __Phantom read__
133−--
134−-- A transaction re-executes a query returning a set of rows that satisfy
128+-- __Phantom read__: A transaction re-executes a query returning a set of rows that satisfy
135-- a search condition and finds that the set of rows satisfying the condition
129-- a search condition and finds that the set of rows satisfying the condition
136-- has changed due to another recently-committed transaction.
130-- has changed due to another recently-committed transaction.
137--
131--
138−-- __Serialization anomaly__
139−--
140−-- The result of successfully committing a group of transactions is inconsistent
132+-- __Serialization anomaly__: The result of successfully committing a group of transactions is inconsistent
141-- with all possible orderings of running those transactions one at a time.
133-- with all possible orderings of running those transactions one at a time.
134+--
142-- In PostgreSQL, you can request any of the four standard transaction
135-- In PostgreSQL, you can request any of the four standard transaction
143-- isolation levels, but internally only three distinct isolation levels are implemented,
136-- isolation levels, but internally only three distinct isolation levels are implemented,
144-- i.e. PostgreSQL's `ReadUncommitted` mode behaves like `ReadCommitted`.
137-- i.e. PostgreSQL's `ReadUncommitted` mode behaves like `ReadCommitted`.
@@ -202,7 +195,7 @@ renderAccessMode = \case
202-- after which it is able to run without the normal overhead of a
195-- after which it is able to run without the normal overhead of a
203-- `Serializable` transaction and without any risk of contributing
196-- `Serializable` transaction and without any risk of contributing
204-- to or being canceled by a serialization failure.
197-- to or being canceled by a serialization failure.
205−-- This mode is well suited for long-running reports or backups.
198+-- This `longRunningMode` is well suited for long-running reports or backups.
206data DeferrableMode
199data DeferrableMode
207 = Deferrable
200 = Deferrable
208 | NotDeferrable
201 | NotDeferrable