O'Reilly logo

Programming Concurrency on the JVM by Venkat Subramaniam

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

Creating Nested Transactions

The methods we call may create their own transactions, and their changes will get independent commits. That’s not adequate if we want to coordinate the transactions in these methods into one atomic operation. We can achieve such coordination with nested transactions.

With nested transactions, all the transactions created by methods we call get rolled into the calling method’s transaction by default. Using Akka/Multiverse provides ways to configure other options like new isolated transactions, among others. As a result, with nested transactions, all the changes get committed only when the outermost transaction commits. It’s our responsibility to ensure that methods complete within the configurable timeout period for ...

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