Introduction to Transactions

A transaction is a logical unit of work with one or more operations. The operations succeed or fail as a single unit. Thus, if we return to our example from a moment ago, if the application fails prior to completing the money transfer, all intermediate steps are undone. It's as if they never occurred. What makes transactions so powerful is that the “undo” step is done automatically by the transactional system. A programmer is not required to code undo operations.[1] The programmer simply starts a transaction (implicitly or explicitly) and then performs a series of transactional operations against resources. If anything goes wrong, the transactional system will ensure that the steps are rolled back.

[1] Undo actions ...

Get IBM WebSphere: Deployment and Advanced Configuration 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.