[jboss-user] [jBPM] - Does the ksession.dispose() work safely?

byungwoojun do-not-reply at jboss.com
Tue May 10 18:39:23 EDT 2011


byungwoojun [http://community.jboss.org/people/byungwoojun] created the discussion

"Does the ksession.dispose() work safely?"

To view the discussion, visit: http://community.jboss.org/message/604592#604592

--------------------------------------------------------------
I am creating a ksession per startProcess, and after use of the ksession, I dispose it (using the processEventListener afterProcessCompleted event). If I test my process one by one, there was no problem with the ksession.dispose(). However, I noticed that if I started multiple processes at a similar time, the ksession.dispose() causes the NullPointerException. When multiple processes are invoked, there are multiple active independent ksession objects, in my case. Then, each process starts calling the ksesion.dispose() when it finishes its job. The first ksession.dispose() function code sets NULL to the applicationScopeEntityManger object after use. As the name indicates, the applicationScopeEntityManager seems to be application-level. Once it is set to NULL, the subsequent ksession.dispose() has a problem using the applicationScopeEntityManager (which is already set to NULL). 

In enterprise application, it is normal there always many processes are invoked concurrently.

So, I started wondering how the ksession.dispose() works??? 

Any suggestion will be appreciated.

bwj
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/604592#604592]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110510/7aaf9c19/attachment.html 


More information about the jboss-user mailing list