Transaction Recovery After Rollback: Commit vs Rollback vs Flashback vs Redo
In database systems, rollback undoes the effects of a transaction that has not been committed (or reverts changes within the scope of a failed/aborted operation), while redo is part of the recovery process used to re-apply changes after a failure (e.g., during crash recovery). Flashback features allow you to view or revert to a prior state using specialized mechanisms rather than a traditional rollback. Commit finalizes a transaction so its changes become durable and are not undone by rollback.
For the question: “Which of the following is used to get back all the transactions back after rollback?” the best answer among the options is (iv) Redo, because redo is used to restore/re-apply changes during recovery so that the system returns to the correct state after undo/rollback-type steps in the recovery workflow.
Key terms introduced next: Rollback Redo Flashback Commit.
Database Transactions: Commit vs Rollback (Crash Recovery Intuition)
Conceptual recovery model (Undo vs Redo)
Many recovery approaches can be understood as separating “undoing wrong/unwanted effects” from “re-applying correct effects.” In that mental model:
- Rollback/Undo addresses the effects of transactions that should not remain (e.g., aborted work).
- Redo ensures the effects that must persist (e.g., committed work, or changes recorded in logs) are re-applied to reach the correct database state after failure.
This aligns with how exam questions usually test transaction recovery: after rollback/undo, the mechanism that “gets back” the intended history is redo.
Transaction Lifecycle & Recovery Phases (High-Level)
Transaction runs
1. ExecuteOperations are performed and tracked (often via logs)."
Commit succeeds
2. Commit pathChanges become durable; later recovery should preserve them."
Rollback/undo
3. Rollback pathChanges from aborted/uncommitted work are reversed."
Redo reapplies
4. Recovery finishingRe-applies logged changes to reach a consistent state."
How redo “restores” state after rollback/undo (process view)
- 1Step 1
Use logs to determine what must be undone and what must be preserved.
- 2Step 2
Revert the effects of transactions that should not remain (e.g., uncommitted).
- 3Step 3
Re-apply logged updates for transactions/operations that must be reflected in the final correct state.
- 4Step 4
Database returns to a state that satisfies the recovery correctness criteria.
Which option matches “get back all transactions back after rollback?”
Interpretation based on recovery roles (conceptual, exam-style).
Exam shortcut
If the question mentions rollback/undo and asks what brings the system back to the correct state using recovery mechanics, the expected answer is typically Redo.
Don’t confuse rollback with commit
Rollback reverses changes; Commit finalizes them. After commit, rollback does not “get them back”—it can’t undo durable changes in the normal semantics. Recovery uses redo/undo rather than commit acting as a “restore” button.
Quick comparisons for the four options
Transaction Recovery Flashcards
Knowledge Check
Which of the following is used to get back all the transactions back after rollback?