Transactions

Consider the Transfer funds use case discussed in earlier chapters. The use case boils down to debiting one account and crediting the equivalent amount to another account.

A problem arises when a failure occurs after the funds have been debited from the first account but not yet credited to the second account. This is problematic because, in general, you would want both the debit and credit to take place or, if one failed, neither to take place. In other words, the set of activities is closely tied to each other, and you want them to be carried out as if they were a single unit-of-work.[3] This unit-of-work is commonly referred to as a business transaction or simply transaction.

[3] From Richard Monson-Haefel's Enterprise JavaBeans ...

Get Developing Enterprise Java Applications with J2EE™ and UML 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.