Information Technology Reference
In-Depth Information
4 ı Serializable: the transaction may not do dirty writes, dirty reads, or unrepeatable
reads of any type. At this, the highest isolation level, the dirty writes, dirty reads
and unrepeatable reads as we have defined above are not permitted.
The DB2 terminology for the isolation levels corresponds more closely to that
used in this topic. In DB2 terminology, the term “repeatable read” is used to denote
the highest level, 4 ı , while the next highest level, 3 ı , is called read stability .
According to the SQL standard, the highest, 4 ı serializable, isolation level is the
default, but a database management system may not be able to provide better than
the next highest, 3 ı or repeatable-read-level isolation for the transactions. Any of
the isolation levels 1 ı -3 ı can be guaranteed for a transaction, if at least level 1 ı is
required of all other transactions. To increase concurrency, some transactions may
be allowed to run at an isolation level that is weaker than normal.
5.6
Isolation and Transaction Rollback
Let H be a history for transaction set f T 1 ;:::;T n g that can be run on a database D to
produce a database D 0 . The transaction set can include forward-rolling, committed,
backward-rolling, and rolled-back transactions.
We consider a forward-rolling transaction T i D i in H .NowT i wants to
abort. Then T i must be extended to the rolled-back transaction B˛ i i C .A
natural requirement is that this rollback must be possible in H .Inotherwords,
it must be possible to run the extended history HA˛ i C on D, which means that
the extension sequence A˛ i C must be runnable on D 0 .
The following example demonstrates that rollback may not be possible if the
history contains dirty writes.
Example 5.22 Consider the transactions
T 1 D BW Œx; u ;1 and
T 2 D BD Œx; u C
and their history:
H 1 D T 1 : BW Œx;0;1
T 2 : BD Œx; 1C .
This history can be run on a database D that contains the tuple .x; 0/ and will
produce the database D 0 D D nf .x; 0/ g .
Now T 1 wishes to abort, so BW Œx;0;1 is completed to the rolled-back transac-
tion BW Œx;0;1 AW 1 Œx;0;1C. However, the respective completed history
AW 1 Œx;0;1C
H 0 1 D T 1 :
BW Œx;0;1
T 2 : BD Œx; 1C .
cannot be run on D, because the database no longer contains the tuple .x; 1/
when T 1 wants to write it. The action DŒx; 1 is a dirty write by the committed
transaction T 2 .
Search WWH ::




Custom Search