Hi Elmo,

Sorry I keeps on bothering you. Hopefully I didn't interfere your normal work.

Ummm... It is a long story. In our project, we wish to use jBPM engine to 
process incoming events. We treat a ProcessInstance as the big boss. When the 
program starts, a ProcessInstance will be created, process something and 
reached a wait state. The most simpliest ProcessDefinition we have created is 
something like this.


  | <Start> ---> <Event Listener> ---> <Process it> ---> <End1>
  |                              ^-----------------------+
  | 

The ProcessInstance will terminate when some conditions are fulfilled. Say it 
has received an END event. We do not exactly knows how many loops it will loop 
through. In above scenario, it will loop forever until the user issued the END 
event.

The problem arise when using loop. If I draw the graph this way, allowing jBPM 
to handle the loop, it will break with StackOverFlow after a few hundred 
rounds. I tried to learn from jBPM source code, and I guess it is because the 
nodes are called recursively, causing function stack overflow. 

I tried to bypass this problem by saving the ProcessInstance into database 
(anyway, my project needs to save everything into the database to guard against 
system crashes). When it has finished one cycle, it suspends and flushes 
everything. Then when another event arrives, it loads back the ProcessInstance, 
puts the event into Context variable, and starts again. This method somehow 
works (of course the performance is horrible, we are not supposed to code like 
this), but the memory consumed will grow slowly, and the performance will 
gradually decline.

About the connection, I am not sure. I have opened MySQL Administrator to have 
a quick check. It has 10 DB connections on average. Looks like Hibernate's 
connection pool has handled most of the problem. I don't know how to check the 
no. of connections in Hibernate. I will see if I can find it out. If the no. of 
Hibernate connections keep on increasing, then it can explain why the program 
gradually stall.

Let me rework my code to see if it improves. Keep in touch.

Thanks for your help.



Philip

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927339#3927339

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927339


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to