2 Replies Latest reply on Nov 28, 2016 1:11 PM by Guru Inamdar

    How do I avoid ARJUNA016082: Synchronizations are not allowed?

    Jari Juslin Newbie

      We are using Infinispan (5.2.1.Final) as a second level cache for JPA/Hibernate (4.2.5.Final) under JBoss 7.2.0.Final.

       

      After migration from JBoss 6, we started getting exceptions like this from more than few places:

       

      12:51:27,667 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (http-/0.0.0.0:8080-1:REST-/rest/runs.) ISPN000136: Execution error: org.infinispan.CacheException: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING

        at org.infinispan.transaction.TransactionTable.enlist(TransactionTable.java:217) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:271) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:245) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.interceptors.TxInterceptor.visitRemoveCommand(TxInterceptor.java:201) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.interceptors.CacheMgmtInterceptor.visitRemoveCommand(CacheMgmtInterceptor.java:137) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.commands.AbstractVisitor.visitRemoveCommand(AbstractVisitor.java:67) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1162) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.CacheImpl.removeInternal(CacheImpl.java:308) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.CacheImpl.remove(CacheImpl.java:302) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.DecoratedCache.remove(DecoratedCache.java:325) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.infinispan.AbstractDelegatingCache.remove(AbstractDelegatingCache.java:313) [infinispan-core-5.2.1.Final.jar:5.2.1.Final]

        at org.hibernate.cache.infinispan.access.TransactionalAccessDelegate.remove(TransactionalAccessDelegate.java:152) [hibernate-infinispan-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.cache.infinispan.collection.TransactionalAccess.remove(TransactionalAccess.java:48) [hibernate-infinispan-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.action.internal.CollectionAction.evict(CollectionAction.java:152) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:64) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:377) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:369) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:292) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:113) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.2.5.Final.jar:4.2.5.Final]

        at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76) [jbossjts-jacorb-4.17.3.Final.jar:4.17.3.Final (revision: 74343b48951c0fdab92316e56bfcaed605d620f6)]

        at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273) [jbossjts-jacorb-4.17.3.Final.jar:4.17.3.Final (revision: 74343b48951c0fdab92316e56bfcaed605d620f6)]

        at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93) [jbossjts-jacorb-4.17.3.Final.jar:4.17.3.Final (revision: 74343b48951c0fdab92316e56bfcaed605d620f6)]

        at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162) [jbossjts-jacorb-4.17.3.Final.jar:4.17.3.Final (revision: 74343b48951c0fdab92316e56bfcaed605d620f6)]

        at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165) [jbossjts-jacorb-4.17.3.Final.jar:4.17.3.Final (revision: 74343b48951c0fdab92316e56bfcaed605d620f6)]

        at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126) [jbossjts-jacorb-4.17.3.Final.jar:4.17.3.Final (revision: 74343b48951c0fdab92316e56bfcaed605d620f6)]

        at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:91) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:252) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
      at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]

      at com.ecolane.mpk.rest.RunRest$$$view14.createRun(Unknown Source) [classes:]

       

      What is common to all these problems is that transaction fails at flush stage, when Hibernate and Infinispan are working to commit the changes and end the transaction.

       

      We are using the default infinispan config that ships with JBoss.

       

      The persistence.xml looks like this:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"

          version="2.0">

        <persistence-unit name="k3_operational_persistence" transaction-type="JTA">

           <provider>org.hibernate.ejb.HibernatePersistence</provider>

              <jta-data-source>Operational:</jta-data-source>

           <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>

        <properties>

        <property name="jboss.entity.manager.jndi.name" value="K3EntityManager" />

        <property name="jboss.entity.manager.factory.jndi.name"

        value="K3EntityManagerFactory" />

                  <property name="hibernate.hbm2ddl.auto" value="validate"/>

           <property name="hibernate.cache.use_second_level_cache" value="true"/>

           <property name="hibernate.cache.use_query_cache" value="true"/>

                  <property name="hibernate.generate_statistics" value="true" />

        </properties>

        </persistence-unit>

      </persistence>

       

      A bug report of one of these cases: [#ISPN-3540] Persisting new entity with cached blind-side @OneToMany CMR field fails on transaction flush. - JBoss Issue…

       

      However, this is not the only one: we are seeing at least three different cases where seemingly valid markups and entities make the Infinispan fail on flush.

       

      Now, the question is: are we doing something fundamentally wrong? We have just taken the pre-built JBoss 7.2.0.Final and upgraded the Hibernate to the latest version in the 4.2.x branch and that's it. It's hard for me to believe the JBoss+Infinispan combo would be this broken when using them in the standard configuration.


      What would be your solution? Package Infinispan with our app and thus be able to use a newer version than 5.2.x and hope the newer versions are less buggy?

       

        • 1. Re: How do I avoid ARJUNA016082: Synchronizations are not allowed?
          Andrew Voumard Newbie

          Hi,

           

          I had the same error when I enabled infinispan cacheing for entity objects. I did two things to fix this: I removed the FULL_XA from the entity cache configuration in standalone.xml, and added a default cache - which I found was also needed after some digging. I think the problem is that at the EntityManager level, you have a transaction running, and then another one is attempted to be started at the infinispan cacheing level (because of the FULL_XA config), and that constitutes a nested transaction, which the ARJUNA016082 error indicates is not supported. My final infinispan subsystem cache config is as follows. Note that I am running in standalone mode:

           

          <subsystem xmlns="urn:jboss:domain:infinispan:1.4">

              <cache-container name="web" aliases="standard-session-cache"

                  default-cache="local-web" module="org.jboss.as.clustering.web.infinispan">

                  <local-cache name="local-web" batching="true">

                      <file-store passivation="false" purge="false" />

                  </local-cache>

              </cache-container>

              <cache-container name="hibernate" default-cache="default"

                  module="org.jboss.as.jpa.hibernate:4">

                  <local-cache name="entity">

                      <eviction strategy="LRU" max-entries="100000" />

                      <expiration max-idle="1000000" />

                  </local-cache>

                  <local-cache name="local-query">

                      <transaction mode="NONE" />

                      <eviction strategy="LRU" max-entries="100000" />

                      <expiration max-idle="1000000" />

                  </local-cache>

                  <local-cache name="timestamps">

                      <transaction mode="NONE" />

                      <eviction strategy="NONE" max-entries="100000" />

                  </local-cache>

                  <local-cache name="default">

                      <eviction strategy="LRU" max-entries="100000" />

                      <expiration max-idle="1000000" />

                  </local-cache>

              </cache-container>

          </subsystem>

           

          Hope that helps

          1 of 1 people found this helpful
          • 2. Re: How do I avoid ARJUNA016082: Synchronizations are not allowed?
            Guru Inamdar Newbie

            Thank you I had similar issue when I was deploying my kjar under EAP kieserver 6.4.0 Advance Queries

             

            Changing standalone-full.xml to add default cache resolved the issue.