Information Technology Reference
In-Depth Information
Give a database that satisfies the integrity constraint and on which the history can
be run. What is the resulting database? What isolation anomalies (i.e., dirty writes,
dirty reads, and unrepeatable reads) does the history contain?
5.4 The integrity constraint of the database states that the value in the tuple with
key 0 must be the sum of the values of two tuples with successive keys. Are the
transactions of the forms
T 1 D BR Œx; 1; u RŒy; > x; v DŒ0; w I Œ0; u C v C
and
T 2 D BD Œ2; 2I Œ2; 2C
logically consistent with respect to the integrity constraint? Consider the following
history:
T 1 W
BR Œ1; 1; 1RŒ3; > 1; 3DŒ0; 3I Œ0; 4C
T 2 W BD Œ2; 2
I Œ2; 2C
Give a database that satisfies the integrity constraint and on which the history can
be run. What is the resulting database? What isolation anomalies does the history
contain?
5.5 What isolation anomalies are contained in the following histories?
BS ŒP DŒxI ŒxAŒP I 1 ŒxD 1 ŒxC ŒP
T 1 W
I ŒxC
H 1 D
T 2 W
BR ŒxDŒxC
BR ŒxS ŒP DŒxI ŒxAŒP I 1 ŒxD 1 ŒxC ŒP RŒx
T 1 W
DŒxC
H 2 D
T 2 W
BR ŒxDŒxI ŒxC
BS ŒP RŒxDŒxI ŒxAŒP I 1 ŒxD 1 ŒxC ŒP
T 1 W
I ŒxC
H 3 D
BR ŒxDŒxC
5.6 The transaction, denoted T 1 , generated from the following program fragment
is run concurrently with another transaction, T 2 , that does insertions, updates, and
deletions on relation r .
T 2 W
exec sql set transaction isolation level L;
exec sql select avg (V ) into :a from r ;
exec sql select sum (V ) into :s from r ;
exec sql select count ( ) into :c from r ;
exec sql insert into q values ( :a , :s / :c );
exec sql commit .
How may the result produced by T 1 vary when (a) L = read committed ,(b)L =
repeatable read ,(c)L = serializable ? We assume that all other transactions that
possibly run concurrently with T have isolation level read uncommitted , at least.
5.7 Explain why it is not safe to run the transaction of Example 1.3 at any isolation
level lower than serializable.
5.8 Which of the following statements are true and which are false? All the
transactions in history H are at isolation level 1 ı (read uncommitted).
Search WWH ::




Custom Search