Configure JTA Transactions for Hibernate with Infinispan
To sum up, if you configure Hibernate with Infinispan, apply the following changes to your configuration file:  1. Unless your application uses JPA, you need to select the correct Hibernate transaction factory via hibernate.transaction.factory_class property: If you're running within an application server, it's recommended that you use:   org.hibernate.transaction.CMTTransactionFactory  If you're running in a standalone environment and you wanna enable JTA transaction factory, use:   org.hibernate.transaction.JTATransactionFactory  The reason why JPA does not require a transaction factory class to be set up is because the entity manager already sets it to a variant of CMTTransactionFactory.  2. Select the correct Hibernate transaction manager lookup: If you're running within an application server, select the appropiate lookup class according to "JTA Transaction Managers" table. Example, if you were running with JBoss Application Server, you'd select:   org.hibernate.transaction.JBossTransactionManagerLookup  If you're running standalone and you want to add a JTA transaction manager lookup, things get a bit more complicated. Due to a current limitation, Hibernate does not support injecting a JTA TransactionManager or JTA UserTransaction that are not bound to JNDI. In other words, if you want to use JTA, Hibernate expects your TransactionManager to be bound to JNDI and it also expects that UserTransaction instances are retrieved from JNDI. This means that in an standalone environment, you need to add some code that binds your TransactionManager and UserTransaction to JNDI. With this in mind and with the help of one of our community contributors, we've created an example that does just that: JBoss Standalone JTA Example. Once you have the code in place, it's just a matter of selecting the correct Hibernate transaction manager lookup class, based on the JNDI names given. If you take JBossStandaloneJtaExample as an example, you simply have to add:   org.hibernate.transaction.JBossTransactionManagerLookup  As you probably have noted through this section, there wasn't a single mention of the need to configure Infinispan's transaction manager lookup and there's a good reason for that. Basically, the code within Infinispan cache provider takes the transaction manager that has been configured at the Hibernate level and uses that. Otherwise, if no Hibernate transaction manager lookup class has been defined, Infinispan uses a default dummy transaction manager.