Creating Transactions
We create transactions to coordinate changes to multiple managed references. The transaction will ensure these changes are atomic; that is, all the managed references are committed or all of them are discarded. Outside the transactions, we’ll never see any partial changes. We also create transactions to coordinate a read followed by a write to a single ref.
Akka was built on Scala, and we can enjoy its concise API if we’re using Scala. For programmers who can’t make that switch, Akka also provides a convenient API to use its features from the Java language. Alternately, we may directly use Multiverse STM from Java. We’ll see how to create transactions using Akka in Java and Scala in this section.
First we need an example ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access