I have code running inside an app server, and what I do is create a context in
every method and close at the end. For example, I might have something like
this:
| public void deleteUser(String user) {
| JbpmContext jbpmContext = _jbpmConfig.createJbpmContext();
| try {
| // do some stuff
| }
| finally {
| jbpmContext.close();
| }
|
| public void deleteGroup(String group) {
| JbpmContext jbpmContext = _jbpmConfig.createJbpmContext();
| try {
| // do some other stuff
| }
| finally {
| jbpmContext.close();
| }
|
Where _jbpmConfig is just a cached instance of the JbpmConfiguration object. I
haven't noticed any problems doing things this way. I haven't messed with it
too much, but I imagine that if in one of my methods above, I called another
method and needed a reference to the context, I could call
getCurrentJbpmContext() and I would get the one that I created at the start of
the calling method. I'm sure someone like Ronald can offer more insight (and
hopefully set me straight if I'm way off base here...especially since I have an
application going into system test on Monday using code like that above!)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3950191#3950191
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3950191
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user