Hi,

I'm a newbe with this jbpm. I really hope I can get some help from the experts 
here.
I'm confused about the usage of JbpmContext.

1. When exactly do we need to call JbpmConfiguration.createJbpmContext() vs 
JbpmContext.getCurrentJbpmContext() ?

2. when do we need to close this JbpmContext object ?
In the source code, an instance of JbpmContext is kept using ThreadLocal, so is 
that mean as long as the thread is not dead the JbpmContext object should never 
be closed ? Assuming a code using jbpm is running inside an app server which 
has 15 active threads, should each thread  keep its own JbpmContext and never 
close it ? or is it based on usage, so every time a request arrive on the 
appserver, one thread will serve the reqest, create a new jbpmContext, do the 
transaction (or what ever needed..) and close it after finished ? 
 

2. Base on the source code (if i'm not mistaken of course), JbpmContext is 
created using ObjectFactory and all the constructor parameters needed by the 
new JbpmContext such as Services and ObjectFactory itself is provided by the 
ObjectFactory, but what I don't understand is inside method  
JbpmContext.close(), it actually calls services.close() which in turn close and 
release all the services. How come JbpmContext close the services that it 
doesn't own, I mean, the services object is actually provided by the 
ObjectFactory and the same services object could be used in some other part of 
the code (..in my case I happen to use it, especially for the hibernate 
session), so don't you think JbpmContext should never close the services ? 


Well, I must be wrong at some point here, but I don't have a clue. Please help.


Regards,

Martin

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

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


_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to