Transaction States in DBMS (original) (raw)

Last Updated : 6 Aug, 2025

Transaction states represent the different phases a transaction goes through during its lifecycle in a database system. These states help track the progress and outcome of a transaction to ensure data consistency and integrity.

Different Types of Transaction States in DBMS

These are the different types of Transaction States:

  1. Active State
  2. Partially Committed State
  3. Committed State
  4. Failed State
  5. Aborted State
  6. Terminated State

transition_states_in_dbms

Transaction States

1. Active State

2. Partially Committed

3. Committed

This state of transaction is achieved when all the transaction-related operations have been executed successfully along with the Commit operation, i.e. data is saved into the database after the required manipulations in this state. This marks the successful completion of a transaction.

4. Failed State

If any of the transaction-related operations cause an error during the active or partially committed state, further execution of the transaction is stopped and it is brought into a failed state. Here, the database recovery system makes sure that the database is in a consistent state.

5. Aborted State

If a transaction reaches the failed state due to a failed check, the database recovery system will attempt to restore it to a consistent state. If recovery is not possible, the transaction is either rolled back or cancelled to ensure the database remains consistent.

In the aborted state, the DBMS recovery system performs one of two actions:

6. Terminated State

It refers to the final state of a transaction, indicating that it has completed its execution. Once a transaction reaches this state, it has either been successfully committed or aborted. In this state, no further actions are required from the transaction, as the database is now stable.

**Example of Transaction States

Imagine a bank transaction where a user wants to transfer $500 from **Account A to **Account B. The system should handle the following transaction states:

Active State

Partially Committed State

Committed State

Failed State

Aborted State

These states ensure that either the transaction completes successfully (committed) or the database is restored to its original state (aborted), maintaining consistency and preventing errors.