DBMS Transaction States: A Simple Guide for Students

A simple real life event is a transaction in DBMS. In DBMS, a transaction represents a logical unit of work that simulates some real life event of an individual, organization, or an enterprise. The logical unit of work is sub-divided into operations and executed one-by-one until the transaction is completed.

The operations are database operations like READ, WRITE, UPDATE and DELETE. In a small database, there is no use of transaction processing because of simplicity, however, a huge database has concurrent users trying to execute multiple transactions at the same time, and it where the DBMS emply transaction processing system.

Introduction to Transaction states in DBMS

Every transaction must complete successfully , and after the changes in database (committed) , it must leave database in consistent stable state. If there is a failure, the transaction must abort and rollback the changes. It’s all or nothing. This implies that a transaction always try to leave database in consistent state.

📘 Master DBMS Transaction States Easily!
Download our Transaction States Concept Explainer PDF — includes clear notes, diagrams, and MCQs for quick self-assessment.

To ensure the reliability of transaction and maintaining the consistency of database, all transactions go through different states from start to finish. It ensures that update anomalies , duplicates entries does not happen and other database integrity constraints are not violated. The will in turn maintain the consistent state of the database regardless of the success or failure of transactions.

“This mini-post is a condensed version of our detailed guide on Transaction Processing in DBMS: Concepts, Properties and Examples“.

The Six Transaction States

Every transaction goes through the six transaction states mentioned below.

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

Active State

The active state is the start or beginning of a transaction. It is also a state in which operations – READ, WRITE , UPDATE and DELETE are carried out, yet all operations are not finished yet. If all operations are successful transaction can go to partially-committed state or if there is a failure like power outage, system crash, etc , it ca go to failed state.

For example : Transaction – Online Shopping

All activities before makig payment are Active state for online shopping transaction. Let’s list them.

  1. Open shopping website
  2. Selecting items for purchase
  3. Adding items to cart
  4. Addig shippijng address and contact details
  5. Clicking “Proceed to Checkout “
  6. Selecting a payment method

Before you press that “Pay now” button, all activities come under active state.

Partially Committed State

The active state is where you perform the last operation and about to commit you changes permanently to database. Partially-committed state is a state where you have completed all operations and make your changes in a buffer memory , not yet committed.

For example: Transaction – Online Shopping

  1. Press that “Pay Now” button.

All activities after Active state and before Committed state are in Partially-Committed State. Let’s list them from our Online Shopping example.

When you press that pay now button , all operations of the transaction is completed and you are ready to commit to the database.

Committed State

The Committed state is a state of completion of the transaction. The changes are permanently stored in the database. It cannot be undone even after a failure and mark a successful transaction.

For example: All operations after Partially-Committd state before a Failed state is Committed State. There is a chance that during the process of committing changes database or system could fail. Then the transaction enter failed state instead of committed state.

For example : Transaction – Online Shopping

  1. You pay the amount using selected payment method.

After the payment , your purchase is completed and cannot be undone because amount is deducted from your bank account. This means your transaction is committed and successful.

Failed State

In database management system (DBMS) , a Failed State is a state which means the transaction could not continue its execution due to system error , power failure or violation of integrity constraints. or example: Transaction – Online Shopping

  1. You lost internet trying to pay for the purchase.

There are two ways to enter a Failed state.

  • from active state
  • from partially-committed state

In all cases, the transaction cannot proceed to a Committed state, instead it goes to an Abort state.

Abort State

In the Abort state, all the changes are rolled back. If a transaction enters Failed state , and suppose the problem is fixed, that does not mean a Failed state goes to Consistent state automatically. Instead, a roll back is initiated and the transaction is marked to be in Aborted state.

For example: Transaction – Online Shopping

  1. Because you lose internet connection and cannot pay. The roll back operation is to cancel the purchase and send you back to the cart. Any amount deducted from your bank account will be refunded. The DBMS roll back the amount deducted from you and database be still in a consistent state.

Two thinks can happen after a rollback (Abort state).

  1. User can restart the transaction.
  2. System can terminate the transaction permanently.

Terminated State

Regardless of the outcome of the transaction, a successful or a failed transaction is terminated. It means it is removed from the system completely. It means DBMS has nothing more to do.

In our example transaction, Online Shopping

  1. You were able to pay for the purchase and completed transaction committed to database. DBMS mark this transaction as terminated.
  2. You entered a failed state because of failed internet connection while paying for the purchase online, changes made so far is rollbacked(Abort state). The DBMS mark this as terminated because there is nothing to do unless problem is fixed.

These six transaction states complete the life cycle of a DBMS transaction.

(You can also download the Transaction States Mini PDF with examples, diagrams, and MCQs — perfect for quick revision.)

Transaction States Diagram in DBMS

The simple diagram for six states diagram is given below;

The six states of transaction in DBMS
Figure 1 – The Six States of Transaction

Summary

Transaction represents some real life events of an enterprise or organization. A transaction is logical unit of works divided into several read/write operations. When a transaction begins it must complete successfully or roll back changes in case of failure to leave the database in a consistent stable state.

Transaction StateDescription
Active StateTransaction begin executing operations but not yet finished.
Partially-Committed StateTransaction finished all operations and ready to commit.
Committed StateTransaction has stored all information to the database permanently.
Failed StateTransaction unable to proceed due to error or failure.
Abort StateTransaction has completed the roll back for changes.
Terminated StateTransaction committed or failed , must be removed from the system (terminated).

“For a complete explanation, examples, and practice questions, see the full article: Transaction Processing in DBMS.

👉 Don’t forget to download the Transaction States Mini PDF for quick revision and self-assessment.