Bug 779176 (SOA-1571) - JBPM-2608: JobSession.findJobsWithOverdueLockTime returns incorrect list of overdue jobs for LockMonitorThread
Summary: JBPM-2608: JobSession.findJobsWithOverdueLockTime returns incorrect list of o...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-1571
Product: JBoss Enterprise SOA Platform 4
Classification: JBoss
Component: JBPM - within SOA, JBPM - standalone
Version: 4.3 CP02
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.3 CP04 ER1
Assignee: Alejandro Guizar
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-28 11:15 UTC by Martin Weiler
Modified: 2010-03-24 12:36 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-24 12:36:28 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-1571 0 None None None Never

Description Martin Weiler 2009-10-28 11:15:21 UTC
Date of First Response: 2009-12-02 20:30:19
Help Desk Ticket Reference: https://enterprise.redhat.com/issue-tracker/351664
Workaround Description: 1. Open $SOA_HOME/jbpm-jpdl/src/jpdl/org/jbpm/db/hibernate.queries.hbm.xml
2. Replace 'where job.lockTime > :threshold' with 'where job.lockTime < :threshold'
3. Copy $SOA_HOME/jbpm-jpdl/src/jpdl/org/jbpm/db/hibernate.queries.hbm.xml to $SOA_HOME/jboss-as/server/$SOA_CONFIG/deploy/jbpm.esb/
4. Open $SOA_HOME/jboss-as/server/$SOA_CONFIG/deploy/jbpm.esb/hibernate.cfg.xml
5. Replace 
<mapping resource="org/jbpm/db/hibernate.queries.hbm.xml"/>
with
<mapping resource="hibernate.queries.hbm.xml"/>

project_key: SOA

Platform issue for JBPM-2608: JobSession.findJobsWithOverdueLockTime returns incorrect list of overdue jobs for LockMonitorThread

Comment 1 Martin Weiler 2009-10-28 11:15:57 UTC
Link: Added: This issue depends JBPM-2608


Comment 2 Martin Weiler 2009-10-28 11:22:09 UTC
The incorrect behavior of the LockMonitorThread can be reproduced with a modified bpm_orchestration1 quickstart:

1. In $SOA_HOME/jboss-as/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml, add a Thread.sleep to simulate a longer running action:

   <node name="node2">
      <event type="node-enter">
        <script>
            System.out.println(&quot;****** jBPM SLEEP *****&quot;);
            Thread.sleep(10000);
        </script>
      </event>
      [...]
   </node>

2. In $SOA_HOME/jboss-as/server/$SOA_CONFIG/deploy/jbpm.esb/jbpm.cfg.xml lower the lockMonitorInterval value to make sure the LockMonitor attempts to unlock overdue job within the time the thread above is sleeping:

  <bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor">
      [...]
    <field name="lockMonitorInterval"><int value="3000" />
      [...]
  </bean>

3. Deploy and run the quickstart as usual, which will result in a StaleObjectStateException on the LockMonitorThread.

Comment 3 Alejandro Guizar 2009-12-03 01:30:19 UTC
Resolving platform issue as the project peer JBPM-2608 has been resolved.

Comment 4 David Le Sage 2010-02-25 05:33:38 UTC
Please review the following draft text for the Resolved Issues section of the Release Notes:

https://jira.jboss.org/jira/browse/JBPM-2608

    org.jbpm.job.executor.LockMonitorThread#unlockOverdueJobs() used an
    erroneous query to return the list of overdue logs to be unlocked. As a consequence, an
    org.hibernate.StaleObjectStateException exception would occur.

    To rectify this problem the where clause in the query has been reordered and the
    JobSession.findJobsWithOverdueLockTime now passes the threshold as a timestamp
    rather than a date. As a result, an accurate list of overdue jobs is now returned and the exception
    is no longer generated.


Comment 5 Martin Vecera 2010-03-24 12:36:28 UTC
Verified in 4.3.CP03 ER1


Note You need to log in before you can comment on or make changes to this bug.