Chapter 9. Transactions

In computing, the mean time to failure keeps getting shorter.

—Alan Perlis, Epigrams in Programming

In this chapter we are going to explore a fundamental tool for dealing with partial failure: transactions. Transactions provide a means of enforcing consistency over a set of (one or more) space-based operations. By consistency we mean that transactions allow space-based operations to be bundled together in such a way that either all complete, or none of them do—in other words, a set of operations will never be “half” completed.

An example can help in understanding the value of transactions. Consider our web counter example from Chapter 3—each time a web page is visited, an applet takes a page count entry, increments its ...

Get JavaSpaces™ Principles, Patterns, and Practice 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.