next up previous
Next: Checkpoints Up: NORMAL PROCESSING Previous: Total or Partial Rollbacks

Transaction Termination

If two-phase commit protocol is used to terminate transactions and the prepare record includes the list of update-type locks held by the transaction following action is taken. The logging of the locks is done to ensure that if a system failure were to occur after a transaction enters the in-doubt state, then those locks could be reacquired , during restart recovery, to protect the uncommitted updates of the in-doubt transaction. When the prepare record is written, the read locks could be released, if no new locks would be acquired later as part of getting into the prepare state in some other part of the distributed transaction. The pending actions such as dropping of objects , erasing files are logged in the prepare record and they are postponed till the transaction commits.

Once the transaction enters the in-doubt state, it is committed by writing an end record and releasing its locks. Once the end record is written , if there are pending actions , they must be performed. For each pending action which involves erasing or returning a file to the operating system , an OSfile-return redo-only log record is written.

A transaction in the in-doubt state is rolled back by writing a rollback record , rolling back the transaction to its beginning , discarding the pending action list , releasing its locks and then writing the end record.



Vinay V
Mon Apr 12 18:36:08 IST 1999