[jboss-user] [jBPM] - Questions about transactions in jBPM 4.3
HuiSheng Xu
do-not-reply at jboss.com
Mon Jun 14 21:31:04 EDT 2010
HuiSheng Xu [http://community.jboss.org/people/rebody] replied to the discussion
"Questions about transactions in jBPM 4.3"
To view the discussion, visit: http://community.jboss.org/message/547952#547952
--------------------------------------------------------------
Hi Rachel,
What do you mean when you say that "the JobExecutor will start individual transactions to handle these jobs"?
Does a separate transaction mean that the information will be stored in a separate location?
JobExecutor may have more than a thread to handle the waiting jobs. By default, each of thread could handle one job. Each of them will execute in a separate transaction.
The information of jobs are stored in the JBPM4_JOB table. When one of them was picked by jobExecutor, JobExecutor will lock it and try to execute it in a transaction. If Jobexecutor can successly complete this job, it will delete the related job information from database, and try to pick another job. If these were some exceptions occurs, JobExecutor will store the exception information and try to execute the job again.
>
> Also, are you saying that every activity with an async continuation is executed in its own thread? If so, is there any chance of activities being executed out of order? In other words, in a pd: A-B-C (all async), could B start before A finishes? I've tested this and the answer seems to be 'no,' but I just want to be sure that this could never happen.
Yes. If you use fork to create multiply path of async executions, then you cannot tell whick execution will be executed first, which one will be executed second.
But as you said that your process definition is sequence, there is no parallal paths. So when process arrivalled activity A, it will create a async job and return. At that moment, there was only one job for activity A. Until Jobexecutor finished this job, the process will not arrivalled other activities, so there will be no more jobs be created. When jobExecutor finished the job of activity A, then process will continue, and arrivalled activity B then return. The job of activity B will be created and waited jobExecutor to execute. So I needn't worry about the order of sequence process.
Hope this will be some help. :)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/547952#547952]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100614/4b8041b8/attachment.html
More information about the jboss-user
mailing list