Information Technology Reference
In-Depth Information
where x y z, R 1 Œx; z is a read action by a transaction T 1 forward-rolling at
˛R 1 Œx; z LJ and o 2 Œy is a forward-rolling insert action I 2 Œy , delete action D 2 Œy ,
or write action W 2 Œy by some transaction T 2 other than T 1 .
Proof By the definition of an unrepeatable read, H is of the form
H D ˛R 1 Œx; z LJo 2 Œy ,
where x y z , R 1 Œx; z is a read action by a transaction T 1 forward-rolling at
˛R 1 Œx; z LJ,ando 2 Œy is an update action by some transaction T 2 other than T 1 .
If o 2 Œy is an undo action, we can write H either as
H D ˛R 1 Œx; z LJ 0 o 0 2 ŒyLJ 2 o 2 Œy D ˛R 1 Œx; z LJ 0 o 0 2 Œy 0
or as
H D ˛ 0 o 0 2 ŒyLJ 0 R 1 Œx; z LJo 2 Œy D ˛ 0 o 0 2 ŒyLJ 0 R 1 Œx; z 0 ,
depending on whether the forward-rolling update action o 0 2 Œy corresponding to
o 2 Œy is in LJ or in ˛. The former of these is of the desired form, while the latter
exhibits a dirty read.
t
5.4
Isolation Anomalies and Database Integrity
We will show that each of the three isolation anomalies can destroy the integrity
of the database even if the database application programs generate only logically
consistent transactions when run serially on an initially consistent logical database.
In each case we give a concurrent history of just two transactions, both of which
are committed (or rolled back). In each case, only one isolation anomaly is present
in the history, and when the history is run on a consistent database, the result is an
inconsistent database.
The following example demonstrates that a dirty write can easily break the
integrity of a database.
Example 5.16 The integrity constraint for the database states that the database
must have tuples with keys x and y, and the values must always be the same. Let
transaction T 1 be generated from the program
exec sql update r set V D 1 where X D x;
exec sql update r set V D 1 where Y D y;
exec sql commit ,
and let transaction T 2 be generated from the program
exec sql update r set V D 2 where X D x;
exec sql update r set V D 2 where Y D y;
exec sql commit .
Search WWH ::




Custom Search