0 Replies Latest reply on May 15, 2013 2:17 AM by erangac

    Hibernate / Spring transaction issue with Infinispan L2 cache

    erangac

      Hi,

       

      I am trying to use Infinispan as Hibernate L2 cache for an application which use technologies like

       

      Tomcat 6, Hibernate 4 and Spring 3.5. The application running in Tomcat and our current transaction manager is

       

      org.springframework.orm.hibernate4.HibernateTransactionManager

       

      We have introduced following properties to hibernate property file for Infinispan introduction.

       

      hibernate.cache.region.factory_class=org.hibernate.cache.infinispan.InfinispanRegionFactory

      hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory

      hibernate.transaction.jta.platform=org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform

      hibernate.transaction.manager_lookup_class=org.hibernate.cache.infinispan.tm.HibernateTransactionManagerLookup

       

      After the introduction of Infinispan we lost the stability of the application and start to get different errors randomly. I assume our Infinispan configurations are not correct (we use a transactional cache). I think our transaction manager and Infinispan transaction settings not match.  Please advice for correct configuration.

       

      Errors we see

       

      java.lang.IllegalStateException: Transaction TransactionImple < ac, BasicAction: 0:ffff0a1e015a:c2f8:51921dac:3de status: ActionStatus.ABORTED > is not in a valid state to be invoking cache operations on.

       

      org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction

       

      Thanks