Quiz 4 Solutions

1a.  A transaction should be considered as a unit.  It is either executed
     completely or not at all.  Nothing can be done that is a partial
     execution of a transaction.

1b.  The state of a transaction where all operations have been successfully
     executed and the effects of transactions are recorded (in the log).
     Beyond this point, a transaction is considered to be committed and
     writes are supposed to be recorded in the database.

1c.  Needed for undoing the effect of writes that need to be rolled back.
     For rolling back a transaction (cancelling any permanent changes it made).
     --and/or--
     For transaction failures:
     - For a failed transaction, any writes it did permanently will have to
     be undone.
     - For a committed transaction, if it has to be rolled back completely,
     UNDO is still required.

2.                    T1 ----X-----> T2
                      ^              /
                       \            /
                       x,z        z,y
                         \        /
                           > T3 <

     By removing the T1<---z---T3 dependency (conflict), we achieve
     serializability.  That means write3(Z) can be moved anywhere after
     read1(Z) (and before write3(X)).


Wai Gen Yee
Last modified: Wed Dec 15 06:28:04 IST 1999