[jboss-dev-forums] [Design of JBoss jBPM] - Another potential enhancement to jbpm
argo516
do-not-reply at jboss.com
Mon Jan 21 14:15:05 EST 2008
We like jbpm Timer support, however, it does not work with multiple hosts running against a single database scenario.
By digging into JBPM code this appears to stem from the fact that SchedulerThread issues a simple query to get list of all due Timers and then executes them one by one (without locking anything). So it's possible that if two hosts fire SchedulerThread at the same time (this becomes increasingly more likely as the number of hosts grows) some Timers will be executed twice.
I created a new scheduler service that takes care of this problem by properly locking and scanning JBPM_TIMERS table where only one box works on any given timer.
Furthermore, instead of depending on a servlet to kick off the SchedulerThread I made it start automatically with jbpm runtime. This will allow jbpm timers to work outside of J2EE environment. However, I don't feel strongly about the way Timers are kicked off, so if people prefer to continue using the Servlet for compatibility reasons I am ok with that.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121934#4121934
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121934
More information about the jboss-dev-forums
mailing list