
CPSC-608 Database Systems
Fall 2008
Instructor: Dr. Jianer Chen
Office: HRBB 309B
Phone: 845-4259
Office Hours: T-TR 9:35am-10:50am
Assignment # 4
(Due December 2)
1. The following is a sequence of undo-log records written by two trans-
actions Tand U:
(start, T); (T, A, 10); (start U); (U, B , 20); (T, C, 30); (U, D , 40);
(commit U); (T, E , 50); (commit T).
Describe the action of the recover manger, including changes to both disk
and the log, if there is a crash and the last log record to appear on disk is:
(a) (start U)
(b) (commit U)
(c) (T, E , 50)
(d) (commit T)
2. Suppose that there are two lock modes, readlock and writelock. Give
a formal proof that if all transactions in a schedule have two-phase locking
structure, then the schedule is conflict-serializable.
3. For each of the sequences of actions below, tell what hapeens under
the wound-wait deadlock avoidance system and under the wait-die deadlock
avoidance system. Assume the order of deadlock-timestamps is the same
as the order of subscripts for the transactions, that is, T1,T2,T3,T4. Also
assume that transactions that need to restart do so in the order that they
were rolled back.
(a) r1(A), r2(B), w1(C), r3(D), r4(E), w3(B), w2(C), w4(A), w1(D);
(b) r1(A), r2(B), w1(C), w2(D), r3(C), w1(B), w4(D), w2(A).
1