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

JPAWorkingMemoryDbLogger does not log process end for processes without wait-states.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jBPM 5.4.0.Beta1
    • jBPM 5.2
    • Persistence
    • None

    Description

      When one has a process that does not contain wait-states (i.e. there is no safe-point where jBPM persists state to the DB), the JPAWorkingMemoryDbLogger does not log the 'end' of the process. The problem seems to be in the 'updateProcessLog(long processInstanceId)' method. This method tries to select the process instance with the given 'process-id', however, this selection will return an empty list when trying to log the end of a process which has not been flushed to the DB yet.

      The root cause seems to be that 'flush-mode' of the EntityManager is set to COMMIT instead of AUTO somewhere in the jBPM code. This seems to cause that there is no 'flush' executed before the execution of the query. See the semantics of FlushMode in a transactional context as described in the Hibernate Entity Manager Reference Guide, section 3.9.1: http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Web_Platform/5/html-single/Hibernate_Entity_Manager_Reference_Guide/index.html. This document says that a 'flush' is automatically executed before a 'query' if the FlushMode has been set to AUTO. Because the FlushMode is set to COMMIT in jBPM, the 'flush' is not automatically executed by the EntityManager. The 'query' is therefore not able to find the given process instance (which was persisted on process instance start), so the end of the process instance will not be logged.

      I was able to fix the problem my explicitly calling 'flush()' on the EntityManager before executing the query. Another possible solution seems to be to keep the FlushMode on AUTO (which is the default).

      Attachments

        Activity

          People

            swiderski.maciej Maciej Swiderski (Inactive)
            rhn-gps-ddoyle Duncan Doyle (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: