[jboss-jira] [JBoss JIRA] Commented: (JBPM-983) concurrent process execution fails

philipp (JIRA) jira-events at lists.jboss.org
Sun Jun 24 07:17:52 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBPM-983?page=comments#action_12366597 ] 
            
philipp commented on JBPM-983:
------------------------------

Hi all,

I have the same problem in my project. I made some tests with this unittest and found out that the job object is manipulated from different threads and therefore hibernate throws an exception. Then I changed the implementation, so that only one thread is selecting the jobs and different threads (worker thread) are executing the tokens.
Then the next problem occurred. The single thread loads the jobs that are still executed by the worker thread.
See hibernate.queries.hbm.xml:
select job
from org.jbpm.job.Job as job
where ( (job.lockOwner is null) or (job.lockOwner = :lockOwner) )

The problem is that the worker thread also loads the job object. In my test I removed job.lockOwner = :lockOwner.
After that I got the third problem. In the unittest to worker threads reach the join node in the same time. In that case the last worker thread gets a hibernate error. This problem I solved by setting the join to async="true" and synchronising the execution of the tokens by process and node:
syncKey=("synckey"+job.getProcessInstance().getId()+":"+job.getToken().getNode().getId()).intern();
synchronized (syncKey) {
	executeJob(job);
}

After all that the test seems to work parallel with many worker threads.

In the documentation I can read:
1.7. The JBoss jBPM Job Executor
In an enterprise environment, JMS and the EJB TimerSerive can be used for that purpose.

Does this mean that there is a JMS implementation? 


> concurrent process execution fails
> ----------------------------------
>
>                 Key: JBPM-983
>                 URL: http://jira.jboss.com/jira/browse/JBPM-983
>             Project: JBoss jBPM
>          Issue Type: Bug
>          Components: Core Engine
>    Affects Versions: jBPM jPDL 3.2
>         Environment: Hypersonic in-memory database, JobExecutor configured with 5 threads
>            Reporter: Alexander Schlett
>         Assigned To: Tom Baeyens
>         Attachments: SimpleTest.java, SimpleTest.java, SimpleTest.java, SimpleTest.java, SimpleTest.java
>
>
> concurrent execution of async nodes with multiple JobExecutor threads fails. the effect is:
> 1) job sync within JobExecutor fails due to org.hibernate.StaleObjectStateException
> 2) process gets stuck in join node and never ends
> junit test for this is attached, it's a simple process with just a fork and a join and some scripts inbetween.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list