<br>Hi, <br><br>  We have an application that uses JBPM and Drools to execute BPMN 2.0 processes. Our knowledge session gets persisted in a PostgreSQL database and so it is StatefulKnowledgeSession.<br><br>  Our application runs inside a JBoss 7.x server, our JPA context uses the bundled Hibernate 4.x as entity manager and JBoss Tx service ( bundled with jboss) as hibernate&#39;s transaction JTA implementation.<br>

<br>  From time to time ( we haven&#39;t found a way to reproduce this, but clearly has occurrences in the execution of our application ) we are getting this kind of exceptions:<br><br><br>Caused by: org.hibernate.exception.GenericJDBCException: Connection is not associated with a managed connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@253770bd<br>

<br>during commits induced by Drools [org.drools.persistence.jta.JtaTransactionManager.commit] ( as you can see in the full stacktrace attached at the bottom of this mail ) <br><br>The problem here is that our processes stop executing because of this exception. For instance, there are times when this exception arises when commiting a transaction that contains a human task persistance and because of the exception this information is lost, breaking our processes ( now nobody will never be ever able to restart the process by completing a human task ).<br>

<br><br>Have any of you found this situation before? Any insight?<br><br><br><br><br><br><br><br><br><br>12:27:47,677 WARN  [com.arjuna.ats.arjuna] (pool-11-thread-1) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple&lt; 0:ffffc0a802fb:-1f97a856:5093fdd2:620, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@79da2820 &gt;: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Connection is not associated with a managed connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@253770bd<br>

        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]<br>        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]<br>

        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]<br>        at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1481) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]<br>

        at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]<br>

        at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]<br>        at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)<br>

        at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)<br>        at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)<br>        at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)<br>

        at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)<br>        at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)<br>

        at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)<br>        at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:167)<br>

        at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179) [drools-persistence-jpa-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]<br>        at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:376) [drools-persistence-jpa-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]<br>

        at org.drools.persistence.jpa.JpaTimerJobInstance.call(JpaTimerJobInstance.java:34) [drools-persistence-jpa-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]<br>        at org.drools.persistence.jpa.JpaTimerJobInstance.call(JpaTimerJobInstance.java:14) [drools-persistence-jpa-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]<br>

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.6.0_18]<br>        at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.6.0_18]<br>        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165) [rt.jar:1.6.0_18]<br>

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266) [rt.jar:1.6.0_18]<br>        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.6.0_18]<br>

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.6.0_18]<br>        at java.lang.Thread.run(Thread.java:636) [rt.jar:1.6.0_18]<br>Caused by: org.hibernate.exception.GenericJDBCException: Connection is not associated with a managed connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@253770bd<br>

<br><br clear="all">Alberto R. Galdo<br><a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a><br><br>-<br>