liveBook · Manning

Rollback

As explained in Spring Start Here, Second Edition

A rollback is the operation that undoes a transaction's changes after the transaction cannot complete successfully.

A rollback undoes a transaction’s changes when an operation fails, restoring data to its state at the transaction’s start. It prevents partial updates from leaving data inconsistent. section 13.1

Money transfer

If money is subtracted from one account but adding it to the destination account fails, rollback restores the earlier data instead of leaving money lost. section 13.1

Figure 13.3 A transaction solves possible inconsistencies that could appear if any of the steps of a use case fail. With a transaction, if any of the steps fail, the data is reverted to how it was at the transaction start.

See how a transaction restores data to its starting state when any step fails. section 13.1

How Spring Start Here, Second Edition covers it

How deep it goes
Defines rollback through a failed transaction step and restoration; stops short of explaining Spring’s implementation.
Examples
Uses a money transfer where subtracting succeeds but adding to the destination account fails.
What you can do after
Evaluate/understand how rollback prevents partial updates from leaving data inconsistent.
How it connects
Contrasts rollback with commit as the failure and success outcomes of a transaction.

Also explained in

Compare how 14 books explain rollback →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring Start Here, Second Edition. The section links point to the parts of the book it draws on.