O'Reilly logo

Professional Java™ Development with the Spring Framework by Colin Sampaleanu, Thomas Risberg, Alef Arendsen, Juergen Hoeller, Rod Johnson

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 6. Transaction and Resource Management

This chapter discusses general issues relating to resource and transaction management. We will start with a basic overview of the subject, followed by a discussion of how Spring's transaction management features fit into the bigger picture.

You will see examples of how to configure and use the transactional features that Spring provides in a variety of environments. We will cover local transactions with a single database and distributed "global" transactions in a J2EE system.

We will see how Spring provides powerful declarative and transaction management services, and offers a consistent programming model in all environments.

Background

Transaction processing in J2EE applications is a large topic that merits an entire book for thorough coverage. For a more in-depth discussion we recommend Java Transaction Processing: Design and Implementation by Mark Little, Jon Maron, and Greg Pavlik (Prentice Hall PTR, 2004).

The following discussion will give you enough background to be able to understand Spring's transaction support.

What Is a Transaction?

For the discussion here, we will define a transaction as a unit of work that is made up of a set of operations, against one or more resources, that must be completed in its entirety. One example of a transaction is when you go to the bank and transfer money from your savings account to your checking account. First your savings account is debited and then your checking account is credited. If the credit ...

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