Information Technology Reference
In-Depth Information
database is maintained under all circumstances, we run all updating transactions at
the serializable isolation level.
5.1
Transaction Histories
In fine-granular transaction processing, a transaction T 2 can usually read or write a
data item y in data page p even though another, still active transaction T 1 has read or
written another data item x in the same page p. This is made possible by the latching
protocol described earlier: according to this protocol, a page is kept latched only for
the duration of the read or write action. Also, transaction T 2 should be allowed to
read a data item x that has been read by another, still active transaction T 1 , provided
that no active transaction writes x.
The latching protocol thus allows many different ways in which the action
sequences of concurrently running transactions can be interleaved. Some of these
interleavings are correct and preserve the integrity of the database, but some may
result in inconsistencies in the logical database or prevent recovery from failures.
First we note that in a specific interleaving, an individual transaction may see a
database state that is different from that seen by the transaction executed by the same
database program in some other interleaving. For example, a sequence of database-
program steps that scans the entire database generates a transaction that contains
as many read actions as there are tuples in the database state seen at the moments
the individual actions are executed. That sequence of actions (i.e., the transaction
generated) depends on the interleaving of the actions with updating transactions
that may be running concurrently.
Example 5.1 Consider a set of three transactions of the following forms:
T 1 D BR Œx 1 ;>0; u 1 RŒx 2 ;>x 1 ; u 2 :::RŒ 1 ;>x n ;0C.
T 2 D BI Œ4; 4C .
T 3 D BD Œ2; 2C .
Assume that these transactions are run on the database
f .0; 0/; .1; 1/; .2; 2/; .3; 3/ g .
Obviously, the exact sequence of actions for the transaction of the form T 1 depends,
besides on the contents of the database, also on how the actions are interleaved
with the actions of transactions T 2 and T 3 . The committed state of T 1 can take four
different forms, depending on how the actions of T 1 are interleaved with the actions
of T 2 and T 3 :
1. .T 1 ; BR Œ1; 1RŒ2; 2RŒ3; 3RŒ 1 ;0C/.
2. .T 1 ; BR Œ1; 1RŒ2; 2RŒ3; 3RŒ4; 4RŒ 1 ;0C/.
3. .T 1 ; BR Œ1; 1RŒ3; 3RŒ 1 ;0C/.
4. .T 1 ; BR Œ1; 1RŒ3; 3RŒ4; 4RŒ 1 ;0C/.
Search WWH ::




Custom Search