4 Replies Latest reply on May 13, 2010 8:37 PM by HuiSheng Xu

    Update Deployment Resource

    Maurizio Trifici Newbie

      Hi,

       

      I have to update a deployment resource. I build my new jdpl string, but when I use the updateDeploymentResource method of RepositoryService, I have this error:

       

       

      [12/05/10 18.16.47:795 CEST] 00000026 AbstractFlush E org.hibernate.event.def.AbstractFlushingEventListener performExecutions Could not synchronize database state with session
                                       org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.lob.Lob#0]
      at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1792)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2435)
      at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2335)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2635)
      at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
      at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365)
      at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:88)
      at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:209)
      at $Proxy72.beforeCompletion(Unknown Source)
      at com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
      at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:242)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java:2409)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1642)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1613)
      at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1548)
      at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:241)
      at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:165)
      at com.ibm.ws.Transaction.JTA.UserTransactionImpl.commit(UserTransactionImpl.java:292)
      at org.jbpm.pvm.internal.tx.jta.JtaTransaction.commit(JtaTransaction.java:96)
      at org.jbpm.pvm.internal.tx.jta.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:89)
      at org.jbpm.pvm.internal.tx.jta.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:66)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
      at org.jbpm.pvm.internal.tx.jta.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)
      at org.jbpm.pvm.internal.tx.jta.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
      at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
      at org.jbpm.pvm.internal.repository.RepositoryServiceImpl.updateDeploymentResource(RepositoryServiceImpl.java:113)
      at org.jbpm.integration.console.ProcessEnginePluginImpl.updateDeployment(ProcessEnginePluginImpl.java:177)
      at org.jboss.bpm.console.server.EngineFacade.updateProcess(EngineFacade.java:150)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:618)
      at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
      at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
      at org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1103)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1038)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
      at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:834)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:682)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:566)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:486)
      at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
      at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:118)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)

       

      I'm using JBPM 4.2. This is my jpdl string:

       

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

      <process xmlns="http://jbpm.org/4.0/jpdl" name="Invia avvisi">

          <end g="372,123,48,48" name="EndEvent_1"/>

          <java class="it.iside.task.StampaMessaggio" g="210,107,100,80" method="stampa" name="Invia avvisi">

              <arg>

                  <object expr="#{execution.id}"/>

              </arg>

              <arg>

                  <string value="Messaggio"/>

              </arg>

              <field name="instanceId">

                  <object expr="#{execution.id}"/>

              </field>

              <field name="paramId">

                  <object expr="#{paramId}"/>

              </field>

              <field name="procedureId">

                  <object expr="#{procedureId}"/>

              </field>

              <transition name="SequenceFlow_2" to="EndEvent_1"/>

          </java>

          <start g="106,123,48,48" name="StartEvent_1">

              <transition name="SequenceFlow_1" to="Invia avvisi"/>

          </start>

      </process>

       

      Can anyone help me?

       

      Thanks

        • 1. Re: Update Deployment Resource
          HuiSheng Xu Master

          Hi Maurizio,

           

            I am sorry to say that, at this moment, the updateDeploymentResource() in RepositoryServiceImpl did not finished yet.  Maybe it is caused by the refactor work for id generate strategy.  The id of Lob didn't be initialized, so the value of id always be zero.  And there are still some problems for check confict for updated process definition,  e.g. if you update a already deployed process,  and the name or key of new processs is difference from the old one, then we will get a dead lock.

           

          I think we could create a JIRA issue for this problem, and wait for other people's advice.

          1 of 1 people found this helpful
          • 2. Re: Update Deployment Resource
            Maciej Swiderski Master

            Hi,

             

            I am trying to follow your stack trace to get execution path but there is no such methods:

             

            org.jbpm.integration.console.ProcessEnginePluginImpl.updateDeployment(ProcessEnginePluginImpl.java:177)
            org.jboss.bpm.console.server.EngineFacade.updateProcess(EngineFacade.java:150)
            

             

            Could you please post your environment settings? I mean version of console, jbpm, etc.

             

            In general updateDeploymentResource is not exposed via public API so it is wierd it is executed.

            1 of 1 people found this helpful
            • 3. Re: Update Deployment Resource
              Maurizio Trifici Newbie

              Hi,

               

              I'm using JBPM 4.2 and gwt-console 1.0 (but customized). I have implemented the method updateDeployment into ProcessEnginePluginImpl in this way:

               

               

              public String updateDeployment(String id, boolean versioning, String processName, String jpdl, int codabi) {
                   RepositoryService repoService = this.processEngine.getRepositoryService();
                   if (!versioning) {
                        repoService.updateDeploymentResource(id, "string.jpdl.xml",
                        new ByteArrayInputStream(jpdl.getBytes()));
                        return id;
                   } else {
                        return createDeployment(processName, jpdl, codabi);
                   }
              }
              • 4. Re: Update Deployment Resource
                HuiSheng Xu Master

                Hi Maurizio,

                 

                I cannot find updateDeploymentResource() in RepositoryService.  Did you customize this interface, too?  Now we are focusing on fixing existing bugs.  So if you could open an issue for this scenario, it will be very appreciate.  And please provide a related testcase to reproduce it.  Thank you very much.