[jboss-user] [JBoss jBPM] - Re: Maintenance and Repair Tools
do-not-reply at jboss.com
Mon Aug 17 10:00:23 EDT 2009
anonymous wrote : How do you re-use the jBPM component in multiple applications? Are you distributing a jar and use a central jbpm db for the tables? This is what I am planning to do in one of my projects. But I was also thinking about the possible deadlock issues.
Yes, this is the tricky part. We use a central jBPM database. We have a java app written around jBPM, which can have multiple processing threads. We can run multiple copies of this java app concurrently. A central app manages jBPM requests and forwards them to one of the java apps (but does not call into jBPM directly).
When a start process instance request is made, the central app sends that command to one of the java apps, and saves the instance id that was started along with the id of the app that is running it. From that point on, any request targeted at that process instance will be handled by the same java app.
Similarly, within the java app there is a hash table that links the instance id to the thread number that started the instance, and all operations on that instance are handled by that thread.
As long as the jBPM tables are indexed on all foreign keys (and, if necessary, configured for row locking) the threads can operate on the database without stepping on each other.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249943#4249943
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249943
More information about the jboss-user