6 Replies Latest reply on Aug 15, 2006 3:59 PM by kukeltje

    Ending task in timer timeout action cause exception

    randy.jones

      <task-node name="Waiting for Approval">














      </task-node>




      Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#1]10:28:20,258 [main] ERROR AbstractFlushingEventListener : 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.graph.exe.Token#1]
      at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1635)



        • 1. Re: Ending task in timer timeout action cause exception
          kukeltje

          please use code tags to post a process (do a preview to see the result)

          • 2. Re: Ending task in timer timeout action cause exception
            kukeltje

            and post the code you end the task in and post version numbers and preferably post a unit test (see the testcases of jBPM for examples)

            • 3. Re: Ending task in timer timeout action cause exception
              randy.jones

               

              "randy.jones@jeppesen.com" wrote:
              <task-node name="Waiting for
              Approval">
               <task name="WaitingTask">
               <assignment class="com.jeppesen.sabertooth.workflow.ContentReviewerAssignment"></assignment>
               <controller>
               <variable name="content" access="read"></variable>
               <variable name="comment"></variable>
               </controller>
               <timer duedate="2 seconds" >
               <action class="com.jeppesen.sabertooth.workflow.EscalateToContentManager">
               </action>
               </timer>
              
               </task>
               <transition name="Reject" to="Rework"></transition>
               <transition name="Approve" to="CommitContent"></transition>
               <transition name="Timeout" to="AssignContentTask"></transition> </task-node>
              
              
              
              
              Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#1]10:28:20,258 [main] ERROR AbstractFlushingEventListener : 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.graph.exe.Token#1]
               at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1635)
              
              





              • 4. Re: Ending task in timer timeout action cause exception
                kukeltje

                Since you did not post a stacktrace or the code of the timer as requested, it is still almost impossible to help, but I'll give it a try.

                You probably end the task in the timer, you should not do that. You should define a transition that has be taken and define the open tasks to end if the tasknode is left.

                hth

                • 5. Re: Ending task in timer timeout action cause exception
                  randy.jones

                   

                  Here is workflow:
                  <?xml version="1.0" encoding="UTF-8"?>
                  
                  <process-definition
                   xmlns="" name="verifyConfiguration">
                   <swimlane name="initiator">
                   </swimlane>
                   <start-state name="Create New Content Workflow">
                   <task name="Initiate" swimlane="initiator">
                   </task>
                   <event type="node-leave">
                   <action name="action1" class="com.jeppesen.sabertooth.workflow.action.InitiateActionHandler"></action>
                   </event>
                   <transition name="" to="Setup Content"></transition>
                   </start-state>
                   <task-node name="Setup Content">
                   <task name="InputContentId">
                   <controller>
                   <variable name="content" access="read,write,required"></variable>
                   </controller>
                   <assignment class="com.jeppesen.sabertooth.workflow.ContentAnalystAssignment"></assignment>
                   </task>
                   <event type="node-leave">
                   <action name="updateConentState" class="com.jeppesen.sabertooth.workflow.action.MessageActionHandler">
                   <content></content>
                   </action>
                   </event>
                   <transition name="" to="Waiting for Approval"></transition>
                   </task-node>
                   <task-node name="Waiting for Approval">
                   <task name="WaitingTask">
                   <assignment class="com.jeppesen.sabertooth.workflow.ContentReviewerAssignment"></assignment>
                   <timer name="ContentExpired" duedate="2 seconds" transition="Timeout" >
                   <action class="com.jeppesen.sabertooth.workflow.EscalateToContentManager">
                   </action>
                   </timer>
                   <controller>
                   <variable name="content" access="read"></variable>
                   <variable name="comment"></variable>
                   </controller>
                  
                   </task>
                   <transition name="Reject" to="Rework"></transition>
                   <transition name="Approve" to="CommitContent"></transition>
                   <transition name="Timeout" to="AssignContentTask"></transition> </task-node>
                   <task-node name="Rework">
                   <task name="ReworkTask">
                   <assignment class="com.jeppesen.sabertooth.workflow.ContentAnalystAssignment"></assignment>
                   <controller>
                   <variable name="content" access="read"></variable>
                   <variable name="comment"></variable>
                   </controller>
                   </task>
                   <transition name="" to="Waiting for Approval"></transition>
                   </task-node>
                   <task-node name="AssignContentTask">
                   <task name="PickAction">
                   <assignment class="com.jeppesen.sabertooth.workflow.ContentManagerAssignment"></assignment>
                   <controller>
                   <variable name="content" access="read,required"></variable>
                   <variable name="managerId"></variable>
                   </controller>
                   </task>
                   <transition name="Assign" to="ContentAssignTask"></transition>
                   </task-node>
                   <task-node name="ContentAssignTask">
                   <task name="AssignActor">
                   <controller>
                   <variable name="taskId" access="read,required"></variable>
                   <variable name="actorId" access="read,required">></variable>
                   </controller>
                   <assignment class="com.jeppesen.sabertooth.workflow.ContentAssignAssignment"></assignment>
                   </task>
                   <transition name="" to="Waiting for Approval"></transition>
                   </task-node>
                  
                   <node name="CommitContent">
                  
                   <event type="node-enter">
                   <action name="action1" class="com.jeppesen.sabertooth.workflow.action.CommitContentActionHandler"></action>
                   </event>
                   <transition name="" to="end"></transition>
                   </node>
                   <end-state name="end"></end-state>
                  </process-definition>
                  
                  
                  /*
                   * JBoss, Home of Professional Open Source
                   * Copyright 2005, JBoss Inc., and individual contributors as indicated
                   * by the @authors tag. See the copyright.txt in the distribution for a
                   * full listing of individual contributors.
                   *
                   * This is free software; you can redistribute it and/or modify it
                   * under the terms of the GNU Lesser General Public License as
                   * published by the Free Software Foundation; either version 2.1 of
                   * the License, or (at your option) any later version.
                   *
                   * This software is distributed in the hope that it will be useful,
                   * but WITHOUT ANY WARRANTY; without even the implied warranty of
                   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
                   * Lesser General Public License for more details.
                   *
                   * You should have received a copy of the GNU Lesser General Public
                   * License along with this software; if not, write to the Free
                   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
                   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
                   */
                  package com.jeppesen.sabertooth.workflow;
                  
                  import java.util.Iterator;
                  import java.util.Set;
                  
                  import org.apache.commons.logging.Log;
                  import org.apache.commons.logging.LogFactory;
                  import org.jbpm.JbpmContext;
                  import org.jbpm.context.exe.ContextInstance;
                  import org.jbpm.graph.def.ActionHandler;
                  import org.jbpm.graph.exe.ExecutionContext;
                  import org.jbpm.graph.exe.ProcessInstance;
                  import org.jbpm.identity.Group;
                  import org.jbpm.identity.User;
                  import org.jbpm.taskmgmt.exe.PooledActor;
                  
                  public class EscalateToContentManager implements ActionHandler {
                  
                   private static final long serialVersionUID = 1L;
                  
                   String content;
                   long taskId;
                  
                   public void execute(ExecutionContext executionContext) throws Exception {
                  
                   try {
                   Set pooledActors = executionContext.getTaskInstance().getPooledActors();
                  
                   String taskName = executionContext.getTaskInstance().getName();
                   JbpmContext jbpmContext = executionContext.getJbpmContext();
                  
                   log.info("################ " + taskName + " ##############################");
                   Iterator iter = pooledActors.iterator();
                   while (iter.hasNext()) {
                   PooledActor pool = (PooledActor)iter.next();
                   log.info("### " + pool.getActorId());
                   // UserBean userBean = new UserBean(jbpmContext);
                   // Group group = userBean.getGroup(pool.getActorId());
                   // Set groupSet = group.getUsers();
                   // Iterator actors = groupSet.iterator();
                   // while (actors.hasNext()) {
                   // User user = (User)actors.next();
                   // log.info("### "+user.getName()+", task '"+taskName+"' is waiting for you.");
                   // }
                   }
                   executionContext.setVariable("comment", "Escalation");
                   log.info("### Task : " + executionContext.getTaskInstance().getId());
                   //executionContext.getTaskInstance().end("Timeout");
                   //executionContext.leaveNode("Timeout");
                   log.info("###########################################################");
                   } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   }
                  
                  
                   }
                  
                   private static final Log log = LogFactory.getLog(EscalateToContentManager.class);
                  }
                  
                  
                  
                  
                  08:23:39,247 [main] INFO MainDriver : Due in = 1594 ms
                  08:23:40,841 [main] DEBUG JbpmContextInfo : creating jbpm context with service factories '[scheduler, persistence, authentication]'
                  08:23:40,841 [main] DEBUG JbpmContext : creating JbpmContext
                  08:23:40,841 [main] DEBUG DbPersistenceServiceFactory : creating persistence service
                  08:23:40,841 [main] DEBUG DbPersistenceService : creating hibernate session
                  08:23:40,841 [main] DEBUG DbPersistenceService : beginning hibernate transaction
                  08:23:40,841 [main] DEBUG SchedulerThread : checking for timers
                  08:23:40,841 [main] DEBUG MemoryStore : org.jbpm.graph.def.ActionCache: MemoryStore hit for org.jbpm.graph.def.Action#3
                  08:23:40,841 [main] DEBUG Cache : org.jbpm.graph.def.Action: Is element with key org.jbpm.graph.def.Action#3 expired?: false
                  08:23:40,841 [main] DEBUG MemoryStore : org.jbpm.instantiation.DelegationCache: MemoryStore hit for org.jbpm.instantiation.Delegation#5
                  08:23:40,841 [main] DEBUG Cache : org.jbpm.instantiation.Delegation: Is element with key org.jbpm.instantiation.Delegation#5 expired?: false
                  08:23:40,841 [main] DEBUG SchedulerThread : found timer timer(ContentExpired,com.jeppesen.sabertooth.workflow.EscalateToContentManager,08:23:40,841)
                  08:23:40,841 [main] DEBUG SchedulerThread : executing timer 'timer(ContentExpired,com.jeppesen.sabertooth.workflow.EscalateToContentManager,08:23:40,841)'
                  08:23:40,888 [main] DEBUG MemoryStore : org.jbpm.taskmgmt.def.TaskCache: MemoryStore miss for org.jbpm.taskmgmt.def.Task#2
                  08:23:40,888 [main] DEBUG Cache : org.jbpm.taskmgmt.def.Task cache - Miss
                  08:23:41,013 [main] DEBUG Cache : org.jbpm.taskmgmt.def.Task: Is element with key org.jbpm.taskmgmt.def.Task#2 expired?: false
                  08:23:41,028 [main] DEBUG MemoryStore : org.jbpm.taskmgmt.def.Task.eventsCache: MemoryStore miss for org.jbpm.taskmgmt.def.Task.events#2
                  08:23:41,028 [main] DEBUG Cache : org.jbpm.taskmgmt.def.Task.events cache - Miss
                  08:23:41,028 [main] DEBUG Cache : org.jbpm.graph.def.Event: Is element with key org.jbpm.graph.def.Event#3 expired?: false
                  08:23:41,028 [main] DEBUG Cache : org.jbpm.graph.def.Event: Is element with key org.jbpm.graph.def.Event#3 expired?: false
                  08:23:41,028 [main] DEBUG Cache : org.jbpm.taskmgmt.def.Task.events: Is element with key org.jbpm.taskmgmt.def.Task.events#2 expired?: false
                  08:23:41,044 [main] DEBUG MemoryStore : org.jbpm.graph.def.NodeCache: MemoryStore miss for org.jbpm.graph.def.Node#3
                  08:23:41,044 [main] DEBUG Cache : org.jbpm.graph.def.Node cache - Miss
                  08:23:41,044 [main] DEBUG Cache : org.jbpm.graph.def.Node: Is element with key org.jbpm.graph.def.Node#3 expired?: false
                  08:23:41,044 [main] DEBUG MemoryStore : org.jbpm.graph.def.Node.eventsCache: MemoryStore miss for org.jbpm.graph.def.Node.events#3
                  08:23:41,044 [main] DEBUG Cache : org.jbpm.graph.def.Node.events cache - Miss
                  08:23:41,060 [main] DEBUG Cache : org.jbpm.graph.def.Node.events: Is element with key org.jbpm.graph.def.Node.events#3 expired?: false
                  08:23:41,060 [main] DEBUG MemoryStore : org.jbpm.graph.def.ProcessDefinitionCache: MemoryStore miss for org.jbpm.graph.def.ProcessDefinition#1
                  08:23:41,060 [main] DEBUG Cache : org.jbpm.graph.def.ProcessDefinition cache - Miss
                  08:23:41,091 [main] DEBUG Cache : org.jbpm.graph.def.ProcessDefinition: Is element with key org.jbpm.graph.def.ProcessDefinition#1 expired?: false
                  08:23:41,107 [main] DEBUG MemoryStore : org.jbpm.graph.def.ProcessDefinition.eventsCache: MemoryStore miss for org.jbpm.graph.def.ProcessDefinition.events#1
                  08:23:41,107 [main] DEBUG Cache : org.jbpm.graph.def.ProcessDefinition.events cache - Miss
                  08:23:41,107 [main] DEBUG Cache : org.jbpm.graph.def.ProcessDefinition.events: Is element with key org.jbpm.graph.def.ProcessDefinition.events#1 expired?: false
                  08:23:41,107 [main] DEBUG Timer : executing timer 'timer(ContentExpired,com.jeppesen.sabertooth.workflow.EscalateToContentManager,08:23:40,841)'
                  08:23:41,107 [main] INFO EscalateToContentManager : ################ WaitingTask ##############################
                  08:23:41,107 [main] INFO EscalateToContentManager : ### ContentReviewers
                  08:23:41,122 [main] DEBUG VariableContainer : variable type change. deleting 'comment' from 'TaskInstance[WaitingTask]'
                  08:23:41,122 [main] DEBUG VariableContainer : create variable 'comment' in 'TaskInstance[WaitingTask]' with value 'Escalation'
                  08:23:41,169 [main] INFO EscalateToContentManager : ### Task : 2
                  08:23:41,169 [main] INFO EscalateToContentManager : ###########################################################
                  08:23:41,185 [main] DEBUG MemoryStore : org.jbpm.graph.def.Node.leavingTransitionsCache: MemoryStore miss for org.jbpm.graph.def.Node.leavingTransitions#3
                  08:23:41,185 [main] DEBUG Cache : org.jbpm.graph.def.Node.leavingTransitions cache - Miss
                  08:23:41,200 [main] DEBUG Cache : org.jbpm.graph.def.Transition: Is element with key org.jbpm.graph.def.Transition#3 expired?: false
                  08:23:41,200 [main] DEBUG Cache : org.jbpm.graph.def.Transition: Is element with key org.jbpm.graph.def.Transition#3 expired?: false
                  08:23:41,200 [main] DEBUG Cache : org.jbpm.graph.def.Transition: Is element with key org.jbpm.graph.def.Transition#3 expired?: false
                  08:23:41,200 [main] DEBUG Cache : org.jbpm.graph.def.Node.leavingTransitions: Is element with key org.jbpm.graph.def.Node.leavingTransitions#3 expired?: false
                  08:23:41,200 [main] DEBUG GraphElement : event 'before-signal' on 'TaskNode(Waiting for Approval)' for 'Token(/)'
                  08:23:41,200 [main] DEBUG GraphElement : event 'node-leave' on 'TaskNode(Waiting for Approval)' for 'Token(/)'
                  08:23:41,200 [main] DEBUG GraphElement : event 'transition' on 'Transition(Timeout)' for 'Token(/)'
                  08:23:41,200 [main] DEBUG MemoryStore : org.jbpm.graph.def.Transition.eventsCache: MemoryStore miss for org.jbpm.graph.def.Transition.events#5
                  08:23:41,200 [main] DEBUG Cache : org.jbpm.graph.def.Transition.events cache - Miss
                  08:23:41,216 [main] DEBUG Cache : org.jbpm.graph.def.Transition.events: Is element with key org.jbpm.graph.def.Transition.events#5 expired?: false
                  08:23:41,216 [main] DEBUG MemoryStore : org.jbpm.graph.def.NodeCache: MemoryStore miss for org.jbpm.graph.def.Node#5
                  08:23:41,216 [main] DEBUG Cache : org.jbpm.graph.def.Node cache - Miss
                  08:23:41,216 [main] DEBUG Cache : org.jbpm.graph.def.Node: Is element with key org.jbpm.graph.def.Node#3 expired?: false
                  08:23:41,216 [main] DEBUG GraphElement : event 'node-enter' on 'TaskNode(AssignContentTask)' for 'Token(/)'
                  08:23:41,216 [main] DEBUG MemoryStore : org.jbpm.graph.def.Node.eventsCache: MemoryStore miss for org.jbpm.graph.def.Node.events#5
                  08:23:41,216 [main] DEBUG Cache : org.jbpm.graph.def.Node.events cache - Miss
                  08:23:41,216 [main] DEBUG Cache : org.jbpm.graph.def.Node.events: Is element with key org.jbpm.graph.def.Node.events#3 expired?: false
                  08:23:41,216 [main] DEBUG MemoryStore : org.jbpm.graph.node.TaskNode.tasksCache: MemoryStore miss for org.jbpm.graph.node.TaskNode.tasks#5
                  08:23:41,216 [main] DEBUG Cache : org.jbpm.graph.node.TaskNode.tasks cache - Miss
                  08:23:41,232 [main] DEBUG Cache : org.jbpm.taskmgmt.def.Task: Is element with key org.jbpm.taskmgmt.def.Task#2 expired?: false
                  08:23:41,232 [main] DEBUG Cache : org.jbpm.graph.node.TaskNode.tasks: Is element with key org.jbpm.graph.node.TaskNode.tasks#5 expired?: false
                  08:23:41,232 [main] DEBUG MemoryStore : org.jbpm.taskmgmt.def.TaskControllerCache: MemoryStore miss for org.jbpm.taskmgmt.def.TaskController#4
                  08:23:41,232 [main] DEBUG Cache : org.jbpm.taskmgmt.def.TaskController cache - Miss
                  08:23:41,232 [main] DEBUG Cache : org.jbpm.taskmgmt.def.TaskController: Is element with key org.jbpm.taskmgmt.def.TaskController#4 expired?: false
                  08:23:41,232 [main] DEBUG MemoryStore : org.jbpm.taskmgmt.def.TaskController.variableAccessesCache: MemoryStore miss for org.jbpm.taskmgmt.def.TaskController.variableAccesses#4
                  08:23:41,232 [main] DEBUG Cache : org.jbpm.taskmgmt.def.TaskController.variableAccesses cache - Miss
                  08:23:41,232 [main] DEBUG Cache : org.jbpm.context.def.VariableAccess: Is element with key org.jbpm.context.def.VariableAccess#6 expired?: false
                  08:23:41,232 [main] DEBUG Cache : org.jbpm.context.def.VariableAccess: Is element with key org.jbpm.context.def.VariableAccess#6 expired?: false
                  08:23:41,247 [main] DEBUG Cache : org.jbpm.taskmgmt.def.TaskController.variableAccesses: Is element with key org.jbpm.taskmgmt.def.TaskController.variableAccesses#4 expired?: false
                  08:23:41,247 [main] DEBUG TaskController : creating task instance variable 'content' from process variable 'content', value '1234'
                  08:23:41,247 [main] DEBUG VariableContainer : create variable 'content' in 'TaskInstance[PickAction]' with value '1234'
                  08:23:41,263 [main] DEBUG TaskController : creating task instance variable 'managerId' from process variable 'managerId', value 'null'
                  08:23:41,263 [main] DEBUG VariableContainer : create variable 'managerId' in 'TaskInstance[PickAction]' with value 'null'
                  08:23:41,263 [main] DEBUG GraphElement : event 'task-create' on 'Task(PickAction)' for 'Token(/)'
                  08:23:41,263 [main] DEBUG MemoryStore : org.jbpm.taskmgmt.def.Task.eventsCache: MemoryStore miss for org.jbpm.taskmgmt.def.Task.events#4
                  08:23:41,263 [main] DEBUG Cache : org.jbpm.taskmgmt.def.Task.events cache - Miss
                  08:23:41,263 [main] DEBUG Cache : org.jbpm.taskmgmt.def.Task.events: Is element with key org.jbpm.taskmgmt.def.Task.events#2 expired?: false
                  08:23:41,263 [main] DEBUG MemoryStore : org.jbpm.instantiation.DelegationCache: MemoryStore miss for org.jbpm.instantiation.Delegation#7
                  08:23:41,263 [main] DEBUG Cache : org.jbpm.instantiation.Delegation cache - Miss
                  08:23:41,263 [main] DEBUG Cache : org.jbpm.instantiation.Delegation: Is element with key org.jbpm.instantiation.Delegation#5 expired?: false
                  08:23:41,263 [main] INFO ContentManagerAssignment : ###############################################
                  08:23:41,263 [main] INFO ContentManagerAssignment : ### ContentManagers Assignment
                  08:23:41,263 [main] INFO ContentManagerAssignment : ###############################################
                  08:23:41,263 [main] DEBUG GraphElement : event 'task-assign' on 'Task(PickAction)' for 'Token(/)'
                  08:23:41,263 [main] DEBUG GraphElement : event 'after-signal' on 'TaskNode(Waiting for Approval)' for 'Token(/)'
                  08:23:41,263 [main] DEBUG Services : executing default save operations
                  08:23:41,263 [main] DEBUG HibernateSaveOperation : saving process instance
                  08:23:41,278 [main] DEBUG SaveLogsOperation : ignoring logs. no logging service available.
                  08:23:41,278 [main] DEBUG CascadeSaveOperation : cascading save of 'org.jbpm.graph.exe.ProcessInstance@1b6634c'
                  08:23:41,278 [main] DEBUG SchedulerThread : deleting timer 'timer(ContentExpired,com.jeppesen.sabertooth.workflow.EscalateToContentManager,08:23:40,841)'
                  08:23:41,278 [main] DEBUG JbpmContext : closing JbpmContext
                  08:23:41,278 [main] DEBUG Services : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@200db9
                  08:23:41,278 [main] DEBUG DbPersistenceService : committing hibernate transaction
                  08:23:41,310 [main] DEBUG DbPersistenceService : closing hibernate session
                  08:23:41,310 [main] DEBUG Services : executing default save operations
                  08:23:41,310 [main] DEBUG HibernateSaveOperation : saving process instance
                  08:23:41,310 [main] DEBUG SaveLogsOperation : ignoring logs. no logging service available.
                  08:23:41,310 [main] DEBUG CascadeSaveOperation : cascading save of 'org.jbpm.graph.exe.ProcessInstance@eb67e8'
                  08:23:41,310 [main] INFO MainDriver : Before --> PickAction
                  08:23:41,325 [main] DEBUG GraphElement : event 'task-assign' on 'Task(PickAction)' for 'Token(/)'
                  08:23:41,325 [main] DEBUG GraphElement : event 'task-start' on 'Task(PickAction)' for 'Token(/)'
                  08:23:41,325 [main] DEBUG VariableContainer : variable type change. deleting 'managerId' from 'TaskInstance[PickAction]'
                  08:23:41,325 [main] DEBUG VariableContainer : create variable 'managerId' in 'TaskInstance[PickAction]' with value 'contentManager1'
                  08:23:41,357 [main] ERROR AbstractFlushingEventListener : 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.graph.exe.Token#1]
                   at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1635)
                   at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2208)
                   at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
                   at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
                   at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:84)
                   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
                   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
                   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
                   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
                   at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
                   at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:951)
                   at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:109)
                   at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:37)
                   at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1203)
                   at org.jbpm.db.TaskMgmtSession.findTaskInstances(TaskMgmtSession.java:57)
                   at com.jeppesen.sabertooth.workflow.ProcessInstanceBean.getActorTaskList(ProcessInstanceBean.java:182)
                   at com.jeppesen.sabertooth.MainDriver.process(MainDriver.java:178)
                   at com.jeppesen.sabertooth.MainDriver.main(MainDriver.java:57)
                  08:23:41,357 [main] ERROR TaskMgmtSession : org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#1]
                  Exception in thread "main" org.jbpm.JbpmException: couldn't get task instances list for actor 'contentManager1'
                   at org.jbpm.db.TaskMgmtSession.findTaskInstances(TaskMgmtSession.java:63)
                   at com.jeppesen.sabertooth.workflow.ProcessInstanceBean.getActorTaskList(ProcessInstanceBean.java:182)
                   at com.jeppesen.sabertooth.MainDriver.process(MainDriver.java:178)
                   at com.jeppesen.sabertooth.MainDriver.main(MainDriver.java:57)
                  Caused by: 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:1635)
                   at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2208)
                   at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
                   at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
                   at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:84)
                   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
                   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
                   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
                   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
                   at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
                   at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:951)
                   at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:109)
                   at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:37)
                   at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1203)
                   at org.jbpm.db.TaskMgmtSession.findTaskInstances(TaskMgmtSession.java:57)
                   ... 3 more
                  
                  
                  
                  


                  • 6. Re: Ending task in timer timeout action cause exception
                    kukeltje

                    Great,

                    Several things. You post you end a task in a timer. Looking at the code you don't (anymore) So that is impossible to check. Second, the error post occurs while while retrieving a task list, not when ending a task. Could it be you have multiple threads or something? Besides that, I see you get the exception from the main thread? Are there two jbpm instances running on the same database? Or is your scheduler an external process? The error now is in a completely

                    Again, post a unit test with a process definition that is stripped of all unneeded things.

                    One thing I see that something goes wrong in retrieving a tasklist.

                    at com.jeppesen.sabertooth.workflow.ProcessInstanceBean.getActorTaskList(ProcessInstanceBean.java:1
                    82)

                    Do you do that in the assignment handler to achieve some kind of workloadbalancing?