Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-3470

CommandDelegate.startProcess(...) manages to fail an XA transaction

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • jBPM 5.3
    • jBPM 5.2
    • Console
    • None
    • High
    • Hide

      The (jbpm-gwt-core) CommandDelegate class used in this environment has been modified to use the JPA jbpm-bam classes.

      1. download and install the jbpm-installer
      2. modify the persistence configuration files so that:
        1. only JPA is used (no hibernate.cfg.xml)
        2. only one datasource (jbpmDS) is being used
        3. this means modifying the following files in jbpm-installer:
          • build.xml: make sure all lines having to do with hibernate.cfg.xml are deleted.
          • standalone.xml: remove the ExampleDS datasource, which is (and was never?) being used
          • delete db/hibernate.cfg.xml (CommandDelegate has been modified to use the JPAProcessInstanceDBLog)
          • delete db/testDS1-ds.xml, which is not (and was never?) being used
          • db/persistence.xml: modify this to also include the bam logging classes (ProcessInstanceLog, etc.)
          • lastly, I changed the h2 jdbc url to point to runtime/jbpm-demo instead of ~/test because the runtime directory is automatically cleaned with the clean.demo ant goal.
      3. Start the installer demo
      4. build the package on guvnor (not neccessary)
      5. start a process

      When a process is started, the GWT framework is starting a new thread – which introduces a sessionInfo entity that eventually conflicts with the original (static) one in CommandDelegate

      Show
      The (jbpm-gwt-core) CommandDelegate class used in this environment has been modified to use the JPA jbpm-bam classes. download and install the jbpm-installer modify the persistence configuration files so that: only JPA is used (no hibernate.cfg.xml) only one datasource (jbpmDS) is being used this means modifying the following files in jbpm-installer: build.xml: make sure all lines having to do with hibernate.cfg.xml are deleted. standalone.xml: remove the ExampleDS datasource, which is (and was never?) being used delete db/hibernate.cfg.xml (CommandDelegate has been modified to use the JPAProcessInstanceDBLog) delete db/testDS1-ds.xml, which is not (and was never?) being used db/persistence.xml: modify this to also include the bam logging classes (ProcessInstanceLog, etc.) lastly, I changed the h2 jdbc url to point to runtime/jbpm-demo instead of ~/test because the runtime directory is automatically cleaned with the clean.demo ant goal. Start the installer demo build the package on guvnor (not neccessary) start a process When a process is started, the GWT framework is starting a new thread – which introduces a sessionInfo entity that eventually conflicts with the original (static) one in CommandDelegate

      The following exception is being thrown the first time a process is started. If a subsequent process is started, this exception is not thrown again.

      20:53:01,083 WARN  [com.arjuna.ats.arjuna] (http-localhost-127.0.0.1-8080-8) ARJUNA12125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffffac130308:-26c771fb:4ef38987:31, org.hibernate.ejb.AbstractEntityManagerImpl$1@5b785fd1 >: 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]
      	at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:630) [hibernate-entitymanager-3.4.0.GA.jar:]
      	at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:588) [hibernate-entitymanager-3.4.0.GA.jar:]
      	at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513) [hibernate-entitymanager-3.4.0.GA.jar:]
      	at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:97)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:274)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:94)
      	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:159)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1159)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:119)
      	at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179) [drools-persistence-jpa-5.3.2-SNAPSHOT.jar:]
      	at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:348) [drools-persistence-jpa-5.3.2-SNAPSHOT.jar:]
      	at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223) [drools-core-5.3.2-SNAPSHOT.jar:]
      	at org.jbpm.integration.console.CommandDelegate.startProcess(CommandDelegate.java:310) [jbpm-gwt-core-5.2.1-SNAPSHOT.jar:]
      	at org.jbpm.integration.console.ProcessManagement.newInstance(ProcessManagement.java:80) [jbpm-gwt-core-5.2.1-SNAPSHOT.jar:]
      	at org.jboss.bpm.console.server.FormProcessingFacade.startProcessWithUI(FormProcessingFacade.java:197) [classes:]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_29]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_29]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_29]
      	at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_29]
      	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.2.1.GA.jar:]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59) [classes:]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:480) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      	at java.lang.Thread.run(Thread.java:662) [:1.6.0_29]
      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]
      	at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1782) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366) [hibernate-core-3.3.2.GA.jar:]
      	at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504) [hibernate-entitymanager-3.4.0.GA.jar:]
      	... 45 more
      

            marco.rietveld Marco Rietveld (Inactive)
            marco.rietveld Marco Rietveld (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: