0
0
DBMS Theoryknowledge~10 mins

Transaction states in DBMS Theory - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Transaction states
Start Transaction
Active State
Decision: Commit or Rollback?
Partially Committed
Committed
End Transaction
A transaction starts active, then either commits or aborts, passing through intermediate states before ending.
Execution Sample
DBMS Theory
BEGIN TRANSACTION;
-- perform operations
COMMIT;
Starts a transaction, performs operations, then commits to save changes.
Analysis Table
StepTransaction StateActionResult
1StartBegin transactionTransaction is active
2ActivePerform operationsOperations executed
3ActiveDecide to commitMove to partially committed
4Partially CommittedCommit changesChanges saved, move to committed
5CommittedEnd transactionTransaction ends successfully
💡 Transaction ends after commit; all changes are saved permanently.
State Tracker
Transaction StateStartAfter Step 2After Step 3After Step 4Final
StateStartActivePartially CommittedCommittedEnd
Key Insights - 2 Insights
Why is there a 'Partially Committed' state before 'Committed'?
The 'Partially Committed' state means all operations are done but changes are not yet permanent; this is shown in execution_table step 3 and 4.
What happens if a failure occurs during the 'Active' state?
If failure occurs, the transaction moves to 'Failed' then 'Aborted' state, rolling back changes, which is not shown here but is a common alternate path.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 3, what is the transaction state?
APartially Committed
BCommitted
CActive
DFailed
💡 Hint
Refer to the 'Transaction State' column at step 3 in execution_table.
At which step does the transaction end successfully?
AStep 5
BStep 2
CStep 3
DStep 4
💡 Hint
Check the 'Result' column for when the transaction ends in execution_table.
If the transaction fails during operations, which state would it enter next?
ACommitted
BAborted
CPartially Committed
DActive
💡 Hint
Recall the concept_flow shows failure leads to 'Aborted' state.
Concept Snapshot
Transaction states flow from Start -> Active -> (Commit or Rollback) -> End.
Active means operations are running.
Partially Committed means operations done but not saved.
Committed means changes saved permanently.
Failed and Aborted mean rollback due to error.
Transaction ends after commit or abort.
Full Transcript
A transaction in a database management system goes through several states. It starts with the 'Start' state when the transaction begins. Then it moves to 'Active' while operations are performed. After operations, if the transaction is successful, it moves to 'Partially Committed' where all operations are done but changes are not yet permanent. Then it moves to 'Committed' where changes are saved permanently. Finally, the transaction ends successfully. If an error occurs during 'Active', the transaction moves to 'Failed' and then 'Aborted', rolling back changes and ending the transaction without saving. This flow ensures data integrity and consistency.