<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Re: Concurrency problems with JBPM 5.4
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/jkranes">Jon Kranes</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/829335#829335">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Thomas, thanks for your suggestion.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Unfortunately even I do not use Spring transactions, I still get errors when running multiple threads.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The exception stack (using JBPM transactions without the Spring @Transactional) is:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>10:18:46,495 WARN  [com.arjuna.ats.arjuna] (SimpleAsyncTaskExecutor-2) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffff0a900c53:-5f136b43:51ee90a2:32b, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@785e9b33 >: javax.persistence.PersistenceException: error during managed flush</p><p>          at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1486) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]</p><p>          at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>          at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>          at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)</p><p>          at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)</p><p>          at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)</p><p>          at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)</p><p>          at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)</p><p>          at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)</p><p>          at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)</p><p>          at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:167)</p><p>          at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1011) [spring-tx-3.2.2.RELEASE.jar:3.2.2.RELEASE]</p><p>          at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755) [spring-tx-3.2.2.RELEASE.jar:3.2.2.RELEASE]</p><p>          at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) [spring-tx-3.2.2.RELEASE.jar:3.2.2.RELEASE]</p><p>          at org.drools.container.spring.beans.persistence.DroolsSpringTransactionManager.commit(DroolsSpringTransactionManager.java:65) [drools-spring-5.5.0.Final.jar:5.5.0.Final]</p><p>          at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:155) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]</p><p>          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_25]</p><p>          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_25]</p><p>          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_25]</p><p>          at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_25]</p><p>          at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:128) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]</p><p>          at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:66) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]</p><p>          at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122) [knowledge-api-5.5.0.Final.jar:5.5.0.Final]</p><p>          at org.mitre.irs.eda.bpm.jbpm.KnowledgeSessionFactory.createSession(KnowledgeSessionFactory.java:70) [classes:]</p><p>          at org.mitre.irs.eda.bpm.jbpm.KnowledgeSessionFactory.createKnowledgeSession(KnowledgeSessionFactory.java:57) [classes:]</p><p>          at org.mitre.irs.eda.bpm.service.EventServiceImpl.startProcess(EventServiceImpl.java:44) [classes:]</p><p>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_25]</p><p>          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_25]</p><p>          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_25]</p><p>          at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_25]</p><p>          at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) [spring-aop-3.2.2.RELEASE.jar:3.2.2.RELEASE]</p><p>          at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) [spring-aop-3.2.2.RELEASE.jar:3.2.2.RELEASE]</p><p>          at com.sun.proxy.$Proxy106.startProcess(Unknown Source)</p><p>          at org.mitre.irs.eda.bpm.listener.StartProcessListener.onMessage(StartProcessListener.java:46) [classes:]</p><p>          at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:328) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:546) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:472) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:58) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:107) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:608) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:454) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:471) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:455) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$300(SimpleMessageListenerContainer.java:58) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:548) [spring-rabbit-1.1.4.RELEASE.jar:]</p><p>          at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]</p><p>Caused by: java.lang.NullPointerException</p><p>          at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:148) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>          at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>          at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>          at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1081) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>          at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:315) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>          at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>          ... 44 more</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/829335#829335">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>