1.

During Its Execution, A Transaction Passes Through Several States, Until It Finally Commits Or Aborts. List All Possible Sequences Of States Through Which A Transaction May Pass. Explain Why Each State Transition May Occur.

Answer»

The possible sequences of states are:-

  1. active→PARTIALLY COMMITTED→committed. This is the normal sequence a SUCCESSFUL transaction will follow. After executing all its statements it enters the partially committed state. After enough recovery information has been written to disk, the transaction finally enters the committed state.
  2. active → partially committed → aborted. After executing the last statement of the transaction, it enters the partially committed state. But before enough recovery information is written to disk, a hardware failure may occur destroying the memory contents. In this case the changes which it made to the database are undone, and the transaction enters the aborted state.
  3. active → failed → aborted. After the transaction starts, if it is discovered at some point that normal execution cannot continue (EITHER DUE to internal program errors or external errors), it enters the failed state. It is then rolled back, after which it enters the aborted state.

The possible sequences of states are:-



Discussion

No Comment Found

Related InterviewSolutions