13 Using transactions in Spring apps
This chapter covers
- What a transaction is
- How Spring manages transactions
- Using transactions in a Spring app
One of the most important things we take into consideration when managing data is to keep accurate data. We don’t want specific execution scenarios to end up with wrong or inconsistent data. Let me give you an example. Suppose you implement an application used to share money—an electronic wallet. In this application, a user has accounts where they store their money. You implement a functionality to allow a user to transfer money from one account to another. Considering a simplistic implementation for our example, this implies two steps (figure 13.1):
-
Withdraw money from the source account.
Get Spring Start Here now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.