Transaction States in DBMS: State Diagram, Worked Example and Exam Traps
Trace one database transfer from active to committed, then see exactly what changes when failure strikes before the commit decision becomes durable.
KnowledgeGate Team
Exam prep & CS education

Finishing the last statement of a transaction is not the same event as committing it. Detecting a failure is not the same as completing rollback. In a 300-unit transfer, the success path and both rollback paths preserve the total 2800, but they cross different transaction-state boundaries. For the wider subject route, use CS Fundamentals.
What a transaction state tells you
A transaction is one logical unit of database work. Its state is the DBMS's current progress and recovery classification for that unit. The state tells us what has finished, whether useful work may continue, whether rollback is still pending, and whether a successful outcome is durable.
The six standard teaching states are active, partially committed, committed, failed, aborted, and terminated. Some diagrams omit terminated or fold cleanup into the committed and aborted endpoints, so use the states and arrows supplied in the question.
Transactions and Concurrency Control in DBMS owns the broader foundation: ACID, schedules, serializability, locking, and isolation anomalies. A transaction-state problem is narrower: identify the event that moves one attempt across each lifecycle boundary.
The six transaction states and their boundaries
State | What is true | What is not yet true |
|---|---|---|
Active | Instructions are executing. | Success is not settled. |
Partially committed | The final statement has executed. | The commit outcome is not yet durable. |
Committed | The commit point has been crossed. | Lifecycle cleanup may still remain. |
Failed | Normal execution cannot continue. | Undo may still be pending. |
Aborted | Rollback has completed and the transaction's effects have been removed. | This attempt has not succeeded. |
Terminated | The DBMS has finished the lifecycle and released or discarded remaining bookkeeping resources. | No lifecycle work remains for this attempt. |
The key separations are simple: partially committed is not committed, failed is not aborted, and committed does not merely mean all statements ran. Physical protocols vary. Conceptually, a durable commit decision means the successful outcome must survive later failure.
Worked success path: transfer 300 with exact values
Transaction T1 transfers 300 from A to B. Initially, A=2000 and B=800, so the invariant is A+B=2800. Follow the exact operation trace:
Event | State after the event | Values or durable record |
|---|---|---|
| Active |
|
Read A, compute 2000 - 300, log and write | Active |
|
Read B, compute 800 + 300, log and write | Active |
|
Final statement completes | Partially committed |
|
Append | Partially committed until the record is durable | Commit record not yet durable |
Make the commit record durable | Committed | The successful outcome must survive a later failure |
Release locks and bookkeeping | Terminated | No lifecycle work remains for this attempt |
From BEGIN through both writes, T1 is active. After the final statement, it is partially committed with A=1700, B=1100, and 1700+1100=2800, but success is not durable. Appending <T1,COMMIT> does not change that state. When the record becomes durable, T1 is committed. Cleanup releases locks and transaction-table bookkeeping, then it is terminated.
Write-ahead logging gives two narrow guardrails. An update log record must be durable before its corresponding dirty page is written. The commit decision must be durable before success is acknowledged. This does not require every changed data page to be on disk at commit.

Two failure branches from the same transfer
Failure A occurs immediately after write(A=1700), before B changes. The sequence is active -> failed -> aborted. Failure stops normal execution but restores nothing. Rollback uses <T1,A,2000,1700> to undo A from 1700 to 2000. B remained 800. After undo, T1 is aborted with A=2000, B=800, and 2000+800=2800.
Failure B occurs after write(B=1100) and the final statement, but before <T1,COMMIT> is durable. T1 is partially committed just before failure, then failed. Rollback undoes B from 1100 to 800, followed by A from 1700 to 2000. It is then aborted. This proves why partial commitment remains vulnerable.
Failure point | State just before failure | Undo required | State after rollback | Final A,B,total |
|---|---|---|---|---|
After | Active | A: | Aborted |
|
After final statement, before durable commit | Partially committed | B: | Aborted |
|
If policy permits a retry, call it T1', a new active attempt. Otherwise, the aborted attempt proceeds to terminated. The old attempt does not magically become committed.

Read each valid transition as event plus consequence
The success edges are active -> partially committed when the last statement finishes, partially committed -> committed when the commit decision becomes durable, and committed -> terminated after cleanup. Neither partial commit nor termination is an SQL command in this model.
An error, deadlock-victim choice, explicit abort, constraint failure, or system failure can send an active transaction to failed. A partially committed transaction also fails if durability is not secured. The edge failed -> aborted is crossed only when rollback finishes. Policy may then terminate the attempt or restart the work as a fresh attempt.
After a durable commit, a crash does not move T1 backwards to failed. Recovery must preserve or redo its committed effect, even when every changed data page had not yet been flushed.
Common transaction-state traps and corrections
Calling
T1committed afterwrite(B=1100). The business calculation is complete, but the durable commit boundary is missing. The correct state after the final statement is partially committed.Treating failed and aborted as synonyms. Failed means normal work cannot continue. Aborted means rollback is complete.
Requiring every changed page on disk before commit. That confuses durability with forcing all pages and ignores WAL-based recovery. Use the durable commit decision as the conceptual boundary.
Drawing
committed -> failedorfailed -> committed. Failure before durable commit requires rollback. Failure after durable commit requires recovery to preserve the committed result.Making aborted a compulsory dead end. Read the supplied diagram. It may permit a new retry or termination.
How transaction-state diagrams become questions
A question may hide one state or arrow, name an event and ask for the state, offer a set of transitions, contrast failed with aborted, or ask which values survive a crash. The deciding step is always the same: locate the event relative to the final statement, durable commit, rollback completion, and cleanup.
Use five answer-first checks from T1:
After the final write but before durable commit:
partially committed.After an error but before undo completes:
failed.After A and B return to
2000and800:aborted.After the commit record becomes durable:
committed.After a later crash: recovery preserves
1700and1100for the committed attempt.
DBMS Transaction MCQs: 12 Solved uses sourced questions to test ACID, serializability, recoverability, and locking. DBMS Interview Questions for Freshers turns the same vocabulary into concise verbal checks. State-diagram problems remain narrower: identify the exact boundary event and the values that survive it.
The short version and the next step
The success chain is active -> partially committed -> committed -> terminated. The failure chain is active or partially committed -> failed -> aborted -> retry or terminate. Remember the two boundaries: the last statement finishing does not make the commit durable, and detecting failure does not mean rollback is complete.
Redraw the T1 diagram from memory and recompute both failure branches. For a structured route through DBMS and the rest of GATE CS, use GATE Guidance by Sanchit Sir.
Keep learning
Transaction States in DBMS MCQs: 11 Solved Questions with Explanations
Solve 11 practice MCQs on DBMS transaction states. Each answer explains the state, transition or recovery rule you need to apply.
ER Diagram in DBMS: Complete Guide with Worked Examples for GATE and Interviews
Learn to read a crowded ER diagram, reduce it to the minimum relational tables, and avoid the weak-entity, multivalued-attribute, and relationship traps that change the answer.
ACID Properties in DBMS Explained: Concepts and a Worked Transaction
Build atomicity, consistency, isolation, and durability from one 1,500-unit transfer. Trace failures before and after commit, then classify common question clues.
Transaction Management in DBMS: ACID, Serializability, Locking and Recovery
Learn to trace DBMS transactions from operation sequences to precedence graphs, recovery rules, lock protocols, timestamp checks, and crash handling.





