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

deleting a processInstance without any log related cause an Exception

    XMLWordPrintable

Details

    • Low
    • Hide

      To resolve this bug, the method

      public void deleteProcessInstance(ProcessInstance processInstance);

      in class

      org.jbpm.db.GraphSession

      have to verify the size of the token in Log table:

      // delete the logs for all the process instance's tokens
      query = session.createQuery(deleteLogsForTokens);
      query.setParameterList("tokens", tokens);
      query.executeUpdate();
      // then delete the process instance
      session.delete(processInstance);

      need to be:

      // delete the logs for all the process instance's tokens
      if (tokens.size() > 0) {
      query = session.createQuery(deleteLogsForTokens);
      query.setParameterList("tokens", tokens);
      query.executeUpdate();
      }

      // then delete the process instance
      session.delete(processInstance);

      Show
      To resolve this bug, the method public void deleteProcessInstance(ProcessInstance processInstance); in class org.jbpm.db.GraphSession have to verify the size of the token in Log table: // delete the logs for all the process instance's tokens query = session.createQuery(deleteLogsForTokens); query.setParameterList("tokens", tokens); query.executeUpdate(); // then delete the process instance session.delete(processInstance); need to be: // delete the logs for all the process instance's tokens if (tokens.size() > 0) { query = session.createQuery(deleteLogsForTokens); query.setParameterList("tokens", tokens); query.executeUpdate(); } // then delete the process instance session.delete(processInstance);

    Description

      When deleting process instances calling

      graphSession.deleteProcessInstance(processInstance);

      if a process instance doesn't have any logs, an hibernate error occurs.

      Attachments

        Activity

          People

            tdiesler@redhat.com Thomas Diesler
            dino.lupo_jira Dino Lupo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5 minutes
                5m
                Remaining:
                Remaining Estimate - 5 minutes
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified