Information Technology Reference
In-Depth Information
which reads from the version start-time .T 1 /, runs concurrently with the update
transaction
T 2 D BW Œx; u 0 ; u 2 W Œy; v 0 ; v 2 C .
The following history is possible in a transaction-time database:
T 1 :
BR Œx; u 0 RŒy; v 0
RŒy; v 0 C
T 2 : BW Œx; u 0 ; u 2 W Œy; v 0 ; v 2 C
Here the read action RŒx; u 0 by T 1 must not be termed a dirty read nor must the first
RŒy; v 0 be termed an unrepeatable read, because they read the earlier, committed
versions of the tuples with keys x and y and the write actions by T 2 create new
versions. The history is equivalent to the serial history
T 1 : BR Œx; u 0 RŒy; v 0 RŒy; v 0 C
T 2 : BW Œx; u 0 ; u 2 W Œy; v 0 ; v 2 C
At the end, the database contains the versioned tuples .x; T 0 ; u 0 /, .x; T 2 ; u 2 /,
.y; T 0 ; v 0 /,and.y; T 2 ; v 2 /, and the commit-time table contains the tuples .T 0 ; 0 /
and .T 2 ; 2 /,where 2 is the commit timestamp of T 2 . Note that the reversed serial
history
T 1 :
BR Œx; u 0 RŒy; v 0 RŒy; v 0 C
T 2 : BW Œx; u 0 ; u 2 W Œy; v 0 ; v 2 C
where the commit order of the transactions is the same as in the concurrent history
is not possible at all, because here start-time .T 1 / commit-time .T 2 / and hence T 1
must read the updates of T 2 .
t
When versioning is only used for concurrency control, not all versions of the
database are maintained forever. To prevent unlimited growth of the database, older
versions are periodically purged from the database. Thus it may happen that in the
case of some very old read-only transaction T , the system can no longer provide the
transaction with tuple versions at time start-time .T / for reading. Such a transaction
must be aborted.
Defining the meaning of read actions performed by update transactions is not
so straightforward. An update transaction T may read from the version at start-
time .T /, or from some later version, depending on the isolation level chosen;
besides that T is assumed to see its own updates. Under the isolation levels
to be discussed in this chapter, a read action RŒx; z ; v always reads either
from the version at start-time .T / or from the version of the time when the
read action started, except that tuples inserted or written by T itself always take
precedence.
Thus, in executing a read action RŒx; z ; v on version start-time .T /, if it is found
that the least key x with x z in the database version of start-time .T / is greater than
akeyx 0 that has been inserted or written by T itself and also satisfies x 0 z ,thenT
must read x 0 instead of x.
Search WWH ::




Custom Search