Transaction States
Think of transaction states like a job application process:
-
Active: Transaction is running (like "application submitted")
-
Partially Committed: All operations done, but not yet saved permanently (like "under review")
-
Committed: Successfully completed and saved (like "job offer accepted")
-
Failed: Something went wrong (like "application rejected")
-
Aborted: All changes undone, back to original state (like "withdrew application")
State Transitions:-

Handling External Actions
Problem: Some actions can't be undone (like sending email, dispensing cash) Solution: Perform external actions only AFTER commit
ATM Example:
-
Check balance, deduct amount
-
Commit transaction
-
Only then dispense cash
-
If crash happens after commit but before dispensing, compensating transaction adds money back