O'Reilly logo

AspectJ in Action by Ramnivas Laddad

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. Managing transactions

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required