Book Image

Infinispan data grid platform definitive guide

Book Image

Infinispan data grid platform definitive guide

Overview of this book

Table of Contents (20 chapters)
Infinispan Data Grid Platform Definitive Guide
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Java Transaction API


Infinispan can be prepared to participate in JTA-compliant transactions.

JTA or the Java Transaction API, allows developers to demarcate transactions in a way that makes your code independent of the implementation details of the transaction manager.

With JTA, developers have to worry about getting their code up and running on the platform and using code that manages transactions rather than connections, such as JDBC. JTA exposes several interfaces such as javax.transaction.UserTransaction, where the developer can start the transaction with the begin() method and either the commit() or rollback() method to terminate the transaction and the javax.transaction.TransactionManager API to participate in the transaction lifecycle.

One of the responsibilities of the transaction manager when a transaction is about to be committed is to ensure that everything is committed or rolled back.

When more than one Infinispan instance is involved in the transaction, the management of the commit...