Transaction Rollback
Question
What does ROLLBACK do?
Hint
ROLLBACK reverts the transaction to its starting state.
Explanation
ROLLBACK undoes all changes made in the current transaction, reverting the database to the state before the transaction began. This is useful when an error occurs or a condition is not met. ROLLBACK releases all locks acquired by the transaction. SAVEPOINT allows partial rollback — ROLLBACK TO SAVEPOINT undoes changes after the savepoint but keeps earlier changes. ROLLBACK is essential for maintaining atomicity (the A in ACID). After ROLLBACK, a new transaction must be started.
Related Resources
Related Lessons
- Transactions
Learn transactions.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.