0 Replies Latest reply on Sep 21, 2008 1:55 AM by ppc

    deadlock cycle

    ppc Newbie

      I'm running jbpm 3.1.4 on jboss 4.2.0.GA the persistence is provided by Derby, a Deadlock arise when I configure more than one MDB to process the messages,
      the deadlock is on this code findTaskInstancesByProcessInstance

      @Stateless
      public class ProcessManagerSession .....{
      ...
      
       public Collection<TaskInstance> getActiveTasksByProcessInstance2(Long processId) {
      
      
       List<TaskInstance> taskList = null;
      
       JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
       try {
       ProcessInstance processInstance = jbpmContext.getProcessInstance(processId);
       taskList = jbpmContext.getTaskMgmtSession().findTaskInstancesByProcessInstance(processInstance);
      
       } catch (Exception e) {
       logger.error(e);
       throw new ProcessException("Could not get active tasks ");
       } finally {
       jbpmContext.close();
       }
      
      ...
      ...
      


      Can somebody could give me some pointer to solve this issue ?


      07:39:51,003 ERROR (WorkManager(2)-18:) [JDBCExceptionReporter] A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
      Lock : ROW, JBPM_TASKINSTANCE, (20,6)
      Waiting XID : {3770, S} , SA, select taskinstan0_.ID_ as ID1_180_, taskinstan0_.NAME_ as NAME3_180_, taskinstan0_.DESCRIPTION_ as DESCRIPT4_180_, taskinstan0_.ACTORID_ as ACTORID5_180_, taskinstan0_.CREATE_ as CREATE6_180_, taskinstan0_.START_ as START7_180_, taskinstan0_.END_ as END8_180_, taskinstan0_.DUEDATE_ as DUEDATE9_180_, taskinstan0_.PRIORITY_ as PRIORITY10_180_, taskinstan0_.ISCANCELLED_ as ISCANCE11_180_, taskinstan0_.ISSUSPENDED_ as ISSUSPE12_180_, taskinstan0_.ISOPEN_ as ISOPEN13_180_, taskinstan0_.ISSIGNALLING_ as ISSIGNA14_180_, taskinstan0_.ISBLOCKING_ as ISBLOCKING15_180_, taskinstan0_.TASK_ as TASK16_180_, taskinstan0_.TOKEN_ as TOKEN17_180_, taskinstan0_.SWIMLANINSTANCE_ as SWIMLAN18_180_, taskinstan0_.TASKMGMTINSTANCE_ as TASKMGM19_180_ from JBPM_TASKINSTANCE taskinstan0_, JBPM_TOKEN token1_ where taskinstan0_.TOKEN_=token1_.ID_ and token1_.PROCESSINSTANCE_=? and taskinstan0_.ISSUSPENDED_<>1 and taskinstan0_.ISOPEN_=1
      Granted XID : {3769, X}
      Lock : ROW, JBPM_TASKINSTANCE, (21,6)
      Waiting XID : {3769, S} , SA, select taskinstan0_.ID_ as ID1_180_, taskinstan0_.NAME_ as NAME3_180_, taskinstan0_.DESCRIPTION_ as DESCRIPT4_180_, taskinstan0_.ACTORID_ as ACTORID5_180_, taskinstan0_.CREATE_ as CREATE6_180_, taskinstan0_.START_ as START7_180_, taskinstan0_.END_ as END8_180_, taskinstan0_.DUEDATE_ as DUEDATE9_180_, taskinstan0_.PRIORITY_ as PRIORITY10_180_, taskinstan0_.ISCANCELLED_ as ISCANCE11_180_, taskinstan0_.ISSUSPENDED_ as ISSUSPE12_180_, taskinstan0_.ISOPEN_ as ISOPEN13_180_, taskinstan0_.ISSIGNALLING_ as ISSIGNA14_180_, taskinstan0_.ISBLOCKING_ as ISBLOCKING15_180_, taskinstan0_.TASK_ as TASK16_180_, taskinstan0_.TOKEN_ as TOKEN17_180_, taskinstan0_.SWIMLANINSTANCE_ as SWIMLAN18_180_, taskinstan0_.TASKMGMTINSTANCE_ as TASKMGM19_180_ from JBPM_TASKINSTANCE taskinstan0_, JBPM_TOKEN token1_ where taskinstan0_.TOKEN_=token1_.ID_ and token1_.PROCESSINSTANCE_=? and taskinstan0_.ISSUSPENDED_<>1 and taskinstan0_.ISOPEN_=1
      Granted XID : {3770, X}
      . The selected victim is XID : 3770.
      07:39:51,005 ERROR (WorkManager(2)-18:) [TaskMgmtSession] org.hibernate.exception.LockAcquisitionException: could not execute query