CS 347 -- Assignment #6
Concurrency Control
and Recovery
Due Tuesday, November 26 by 5pm
Recall the following database, taken from your class notes:

- Using the above database what are the series of
R/W/C/A operations for the following transactions?
1a) select * from R where N=41; commit;
1b) update R set N=10 where L='W'; commit;
1c) delete R where L='X'; abort;
1d) select * from R r1, R r2 where r1.N='26' and r2.L='Y' and r1.K=r2.K; commit;
- Are the following legal Strict 2PL histories?
2a) r1[a] r2[b] w2[a] r1[b] r1[c]
2b) r1[a] w2[a] r1[b] w3[b] c1 w2[c] r3[c] c2 c3
2c) r1[a] r3[a] w2[c] r1[b] r3[c] w2[b] c1 c2 c3
2d) r1[a] r3[a] w2[c] r1[b] r3[c] w2[b] c1 c3 c2
- Consider your answers in problem (1). Draw the log (i.e., the chain
of log records) for each operation.
- Consider the following database (actually, inverted file structure).
Suppose T1 reads n1, n3, and modifies b2 and b4, and commits. And then
T2 reads i1, i2 and modifies b1, and commits;

4a) what are the transaction logs for T1, T2?
4b) what is the working directory if shadowing is used?
4c) what is the before image log?