Information Technology Reference
In-Depth Information
In every serial history, transactions are trivially isolated from each other, because
the transaction that reads or writes first is committed or rolled back before the other
transaction performs its action. However, equivalence to a serial history does not
imply isolation.
Example 5.4 The history
T 1 W BR Œ1; 1RŒ2; 2
RŒ4; 4RŒ 1 ;0C
RŒ3; 3
T 2 W
BI Œ4; 4C
T 3 W BD Œ2; 2C
is equivalent to the serial history, T 2 T 1 T 3 , of case (2) in Example 5.2 ,butthe
transactions are not isolated: the action RŒ2; >1; 2 of T 1 is an “unrepeatable read”:
the action cannot be repeated in T 1 after the action DŒ2; 2 of T 3 . In this specific
case, the breach of isolation does not cause any harm. But if T 1 performed some
update based on the output of the action RŒ2; 2,andifT 3 , instead of committing
immediately, aborted and rolled back or inserted a tuple .2; u / with u 6D 2 and then
committed, the integrity of the database might be lost.
t
5.2
Uncommitted Updates
A data item x is dirty or uncommitted at a certain moment if it was last updated
(inserted, written, or deleted) by a transaction T that is still active, and it is possible
that T will still change (i.e., delete, write, or insert) x. Such a future change is
possible if T is forward-rolling (and can thus perform any number of new forward-
rolling database actions) or T is backward-rolling but has not yet restored the
original value to x that existed when T first overwrote it.
In the following, we define precisely the concept of an uncommitted update in
relation to our transaction models. For that purpose, let H be a transaction history
and T one of its active transactions, so that H does not contain the C action
for T ,andletx be a key that is updated in H , so that it is the key of some tuple
inserted, written, or deleted in some action in H .Thekeyx has a dirty update or an
uncommitted update by T in H , if one of the following conditions is true:
1. The last update on x in H is by a forward-rolling update action oŒx (i.e., one of
IŒx, WŒxor DŒx)byT .
2. The last update on x in H is by a backward-rolling action o 1 Œx (i.e., one of
I 1 Œx, W 1 Œx or D 1 Œx)byT such that somewhere before the corresponding
forward-rolling action oŒx (IŒx, WŒxor DŒx)byT there is still some forward-
rolling update action o 0 Œx by T that has not been undone in H .
In case (2), the update on x by o 1 Œx does not yet restore on the tuple with key x
the value that existed at the time when T performed its first update on it. As soon
as the first update on x by T has been undone, x is considered to be committed,
because the tuple has been restored to its most recent committed state.
Search WWH ::




Custom Search