Javatpoint Logo
Javatpoint Logo

States of Transaction

In a database, the transaction can be in one of the following states -


DBMS States of Transaction

Active state

  • The active state is the first state of every transaction. In this state, the transaction is being executed.
  • For example: Insertion or deletion or updating a record is done here. But all the records are still not saved to the database.

Partially committed

  • In the partially committed state, a transaction executes its final operation, but the data is still not saved to the database.
  • In the total mark calculation example, a final display of the total marks step is executed in this state.

Committed

A transaction is said to be in a committed state if it executes all its operations successfully. In this state, all the effects are now permanently saved on the database system.

Failed state

  • If any of the checks made by the database recovery system fails, then the transaction is said to be in the failed state.
  • In the example of total mark calculation, if the database is not able to fire a query to fetch the marks, then the transaction will fail to execute.

Aborted

  • If any of the checks fail and the transaction has reached a failed state then the database recovery system will make sure that the database is in its previous consistent state. If not then it will abort or roll back the transaction to bring the database into a consistent state.
  • If the transaction fails in the middle of the transaction then before executing the transaction, all the executed transactions are rolled back to its consistent state.
  • After aborting the transaction, the database recovery module will select one of the two operations:
    1. Re-start the transaction
    2. Kill the transaction

Next TopicDBMS Schedule




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA