1 Reply Latest reply on Jun 26, 2007 1:33 PM by Gavin King

    jBPM and Seam Events question

    Xinhua Gu Newbie

      hello all,

      i use quartz to trigger a process and in a process action i want to raise an seam event. But i failed to do that. The exception is something about trasaction :

      10:37:19,918 ERROR [DbPersistenceService] hibernate flush failed
      org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#1
      ]
       at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1765)
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2407)
       at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
       at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
       at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:239)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:180)
       at org.jbpm.svc.Services.close(Services.java:211)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jboss.seam.core.ManagedJbpmContext.destroy(ManagedJbpmContext.java:106)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1904)
       at org.jboss.seam.Component.callDestroyMethod(Component.java:1835)
       at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:232)
       at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:484)
       at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:81)
       at org.jboss.seam.core.AbstractDispatcher$Asynchronous.execute(AbstractDispatcher.java:81)
       at org.jboss.seam.core.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:242)
       at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
       at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      10:37:20,230 ERROR [DbPersistenceService] hibernate rollback failed
      java.lang.NullPointerException
       at org.jbpm.persistence.db.DbPersistenceService.rollback(DbPersistenceService.java:271)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:182)
       at org.jbpm.svc.Services.close(Services.java:211)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jboss.seam.core.ManagedJbpmContext.destroy(ManagedJbpmContext.java:106)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1904)
       at org.jboss.seam.Component.callDestroyMethod(Component.java:1835)
       at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:232)
       at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:484)
       at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:81)
       at org.jboss.seam.core.AbstractDispatcher$Asynchronous.execute(AbstractDispatcher.java:81)
       at org.jboss.seam.core.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:242)
       at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
       at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      10:37:20,558 ERROR [Services] problem closing service 'persistence'
      org.jbpm.persistence.JbpmPersistenceException: hibernate flush failed
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:185)
       at org.jbpm.svc.Services.close(Services.java:211)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jboss.seam.core.ManagedJbpmContext.destroy(ManagedJbpmContext.java:106)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1904)
       at org.jboss.seam.Component.callDestroyMethod(Component.java:1835)
       at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:232)
       at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:484)
       at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:81)
       at org.jboss.seam.core.AbstractDispatcher$Asynchronous.execute(AbstractDispatcher.java:81)
       at org.jboss.seam.core.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:242)
       at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
       at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)


      i donot know what happened. Can anyone help me?

      thanks in advance

        • 1. Re: jBPM and Seam Events question
          Gavin King Master

          This is the exception you get from Hibernate when two concurrent transactions try to update the same data (in this case the jBPM token for the process instance). It is probably because your async process runs at the same time as the process that initiated it. Try putting a delay on the async process.