<!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: JTA Problem with multiple sessions
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/sumerus">Sumeru Saha</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/819628#819628">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi Gareth/ Maceij,</p><p>I'm getting the same exception which gareth mentioned at the start of this thread. Unlike Gareth I'm not using any code to initialize &amp; invoke the work item. Currently i'm trying to setup jBoss EAP 6.0 (jBPM 5.3, jboss as 7.1.1) with Oracle XE as the DB. I've duely added a datasource in the standalone.xml (marked it as jta="true") and also changed the datasource name &amp; hibernate dialect class in persistence.xml for both business-central-server.war &amp; jbpm-human-task.war. Since I'm using Oracle XE, i did apply the blow grants also. Now when i'm logging into business-central portal and trying start a new instance of a process, I'm getting the exception. I'm sorry but I'm unable to follow the conversation you guys were having and unable to understand how the question of different threads are arising as I'm just trying to start a new process instance. Do you guys mean that the "buisness-central-server" and the "jbpm-human-task" these 2 entities trying access the same row in DB and thus causing the exception. Please help. I've attached the exception excerpt (from server.log) below. Please help with your valuable suggestion.</p><p>N.B. Also wanted to mention that before this exception appeared, server.log had another exception as below. Could this be contributing to the entire problem?</p><p><span style="text-decoration: underline;">14:51:46,568 ERROR [org.drools.persistence.SingleSessionCommandService] (http-/127.0.0.1:8080-4) Could not commit session: java.lang.RuntimeException: Could not find session data for id 1</span><br/><span style="text-decoration: underline;"> at org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:222) [drools-persistence-jpa-5.3.1.BRMS.jar:5.3.1.BRMS]</span></p><p>Thanks Sumer</p><p><strong>grant execute on sys.dbms_xa to jboss_brms;</strong><br/><strong>grant select on pending_trans$ to jboss_brms; </strong><br/><strong>grant select on dba_2pc_pending to jboss_brms; </strong><br/><strong>grant select on dba_pending_transactions to jboss_brms; </strong><br/><strong>grant execute on dbms_system to jboss_brms;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="text-decoration: underline;">Excerpt from servr.log</span></p><p>14:59:11,825 WARN&#160; [com.arjuna.ats.arjuna] (http-/127.0.0.1:8080-4) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple&lt; 0:ffff0affa703:a307ced:51a32566:37, <a class="jive-link-external-small" href="mailto:org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@145a99c" rel="nofollow">org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@145a99c</a> &gt;: javax.persistence.OptimisticLockException: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.drools.persistence.info.SessionInfo#1]<br/> at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:1401) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1314) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1301) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1495) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<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-5.3.1.BRMS.jar:5.3.1.BRMS]<br/> at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:363) [drools-persistence-jpa-5.3.1.BRMS.jar:5.3.1.BRMS]<br/> at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223) [drools-core-5.3.1.BRMS.jar:5.3.1.BRMS]<br/> at org.jbpm.integration.console.CommandDelegate.startProcess(CommandDelegate.java:120) [jbpm-gwt-core-5.3.1.BRMS.jar:5.3.1.BRMS]<br/> at org.jbpm.integration.console.ProcessManagement.newInstance(ProcessManagement.java:82) [jbpm-gwt-core-5.3.1.BRMS.jar:5.3.1.BRMS]<br/> at org.jboss.bpm.console.server.ProcessMgmtFacade.newInstance(ProcessMgmtFacade.java:209) [classes:]<br/> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_30]<br/> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_30]<br/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_30]<br/> at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_30]<br/> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.3.Final-redhat-1.jar:2.3.3.Final-redhat-1]<br/> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.1.Final-redhat-1.jar:1.0.1.Final-redhat-1]<br/> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59) [classes:]<br/> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]<br/> at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]<br/> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931) [jbossweb-7.0.16.Final-redhat-1.jar:]<br/> at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]<br/>Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.drools.persistence.info.SessionInfo#1]<br/> at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:2368) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3020) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2918) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3247) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:140) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:276) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1214) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:403) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]<br/> ... 48 more</p><p>14:59:11,855 WARN&#160; [org.drools.persistence.jta.JtaTransactionManager] (http-/127.0.0.1:8080-4) Unable to commit transaction: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.<br/> at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)<br/> at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)<br/> at co</p><div class="mcePaste" id="_mcePaste" style="position: absolute; top: 0px; left: 0px;"></div></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/819628#819628">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>