COSC 471/571 quiz 11/15 Name: 1. Consider this schedule. Give the corresponding log. No checkpointing. The data elements x, y, and z are all value 0 in the database files at the start of the schedule. The log entries are of the form: Schedule: time T1 T2 ===== =============== ==================== 1 r(x) 2 r(y) 3 r(z) 4 x += 10 5 z = 15 6 w(x) 7 y = x 8 w(z) 9 w(y) 10 r(x) 11 r(y) 12 commit 13 x = z 14 y = z * 1000 14 w(x) 15 w(y) 16 commit 2. The schedule is repeated here with interleaving blank spaces. Show where the programmer of T1 and T2 should have inserted appropriate locking and unlocking commands to implement two phase locking. The locking/unlocking commands are of the form: r-lock(x) read lock on x w-lock(y) write lock on y unlock(y) release lock on y unlock() release all locks Schedule: time T1 T2 ===== =============== ==================== 1 r(x) 2 r(y) 3 r(z) 4 x += 10 5 z = 15 6 w(x) 7 y = x 8 w(z) 9 w(y) 10 r(x) 11 r(y) 12 commit 13 x = z 14 y = z * 1000 14 w(x) 15 w(y) 16 commit