DBMS Quiz4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Quiz IV: CS432

24 April 2023

1. Consider the following schedule where. for clarity. I have incuded all the
operations that will appear in the log, plhus additional helpful detail. As
sume that all transactions get the locks exactly before the
release then1 afterwards. operation and
T1STARTS
T1 reads item B
T1 writes item B with old value 11, newT value 12
T2 STARTS
T2 reads item B
T2 writes item Bwith old value 12, new value 13
T3 STARTS
T3 reads item A
T3 writes item A with old value 29, new value 30
T2 reads item A
T2 writes item A with old value 30, new value 31
T2 COMMITS
Tl rcads item D
T1 writes item D with old value 44, liew value 45
T3 COMMITS
TI COMMITS

Answer the following questions with brief explanations:


(a) Does the above schedule follows two phase locking protocol" 3
points]
(b) What is the equivalent serial schedule? |2 points]
2. Consider the following log information that involves three transactions.
Assume that the immediate update protocol with check-pointing is used
for crash recovery. And note that the log file does not necessarily record
all operations of a transaction.
Is the schedule, as shown in the log, recoverable? Explain. (3 points)
R(C)
R(A) R(B)

R(B) W(B) R(D) Commit


T?

R(A) R(D) W(D) R(B)


T3

Check Point Crash Point Time

3. Consider schedules H and H2 given below:


HË=n(*).ra(2).r1(2).rs(x),7s(s),w (x), ws(y).r2(y), w2(z), wz()
H; = n(*).r2(z),rs(x),r1(z).ra(v),ra),wi (x), w2 (z), ws (y), wz(y)
These schedules are generated by the following transactions:
T; = n(x),r1(2),wn(x)
T; =r2(z).r2(y),w2(z),w2(y)
3 =r3(*),rs(y), ws(y)
Answer the following questions with brief explanations:
(a) Is HË serializable? 1 point)
(b) Is H, serializablc? [1 point

You might also like