Study smarter with Fiveable
Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.
Transaction states form the backbone of how databases maintain ACID properties—the guarantees that keep your data reliable even when things go wrong. You're being tested on your ability to trace a transaction's journey from start to finish, understand why certain states exist, and predict what happens when failures occur. This isn't just theoretical: every time you've used an ATM, made an online purchase, or saved a document to the cloud, transaction states were working behind the scenes.
The key insight here is that transactions don't just "succeed" or "fail"—they move through a state diagram with specific transitions and rules. Exam questions will ask you to identify which state a transaction is in given a scenario, explain what triggers state transitions, and describe recovery procedures. Don't just memorize the six states—know what conditions cause each transition and what the database system does at each stage.
These states represent a transaction that's actively working. The database is performing operations, and the outcome is still undetermined.
The transaction is "in flight"—reading, writing, and making changes that aren't yet permanent.
Compare: Active vs. Partially Committed—both involve uncommitted changes, but Active means operations are still running while Partially Committed means all operations finished and the system is preparing to make changes permanent. FRQs often test whether you understand this distinction in crash recovery scenarios.
These states represent the final outcomes of a transaction. Once here, the transaction's fate is sealed—either its changes persist forever or they're completely erased.
The database has made a decision: either the transaction's work becomes part of the permanent record, or it never happened at all.
Compare: Committed vs. Aborted—these are the only two "real" outcomes for any transaction. Committed means permanent success; Aborted means complete reversal. The key exam concept: there's no middle ground where "some" changes persist.
These states handle error conditions and resource cleanup. They ensure the system can recover gracefully and continue processing new transactions.
When things go wrong, the database must detect the problem, clean up the mess, and free resources for future work.
Compare: Failed vs. Aborted—Failed is the detection of a problem; Aborted is the response (rollback). A transaction moves from Failed → Aborted → Terminated. If asked "what state handles rollback?" the answer is Aborted, not Failed.
| Concept | States |
|---|---|
| Transaction actively executing | Active |
| Awaiting final commit decision | Partially Committed |
| Permanent success outcomes | Committed |
| Complete rollback outcomes | Aborted |
| Error detection | Failed |
| Resource cleanup / lifecycle end | Terminated |
| Changes still reversible | Active, Partially Committed, Failed |
| Changes finalized (one way or another) | Committed, Aborted, Terminated |
A transaction has executed its last SQL statement but the system crashes before the commit record is written to the log. What state was the transaction in, and what happens during recovery?
Compare and contrast the Committed and Aborted states. What do they have in common, and why are these the only two "real" outcomes?
Which two states both involve uncommitted changes but differ in whether operations are still executing? What triggers the transition between them?
If a deadlock is detected, trace the state transitions a transaction would follow from detection to resource release. Name each state in order.
An FRQ asks you to explain how transaction states support the Atomicity property of ACID. Which states are most relevant to your answer, and why?