This chapter covers
Transaction management overview
Implementing transaction management aspect
Implementing Spring's transaction management
Automatically retrying transactions
Consider the e-commerce example in appendix A. When you add an item to a cart, you remove it from the inventory. What would happen if the operation failed after you added an item to the cart but before it was removed from the inventory? The system would be in an inconsistent state, with the same item counted as being in the shopping cart and in the inventory. To prevent this undesirable situation, you need to execute both operations in a transaction. A transaction defines a unit of work that ensures that the system remains in a consistent state ...