Discussion:
[jboss-user] [jBPM] - Re: When to call kSession.dispose()?
Sukumaran Raghavan
2012-04-28 06:41:06 UTC
Permalink
Sukumaran Raghavan [https://community.jboss.org/people/suku_1983] created the discussion

"Re: When to call kSession.dispose()?"

To view the discussion, visit: https://community.jboss.org/message/732800#732800

--------------------------------------------------------------
+1 ....
I use multiple sessions in my application and i dispose these as soon as i create a new process instance (basically each process instance has its own session). Once i register the work item, i dispose the ksession. I have also passed the ksession as a parameter to my work item handlers and they in turn save the ksession. Basically i want to call ksession.getWorkItemManager().completeWorkItem(workItemId).

Now i am not sure if that call will work or not. It seems to work which is surprising. especially since i disposed my ksession ?
How does this all work ? A lil clarity would help me make more apt design decisions.

Thanks in advance.! !
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Wooi Joe Chuah
2013-04-25 05:59:43 UTC
Permalink
Wooi Joe Chuah [https://community.jboss.org/people/joe.chuah] created the discussion

"Re: When to call kSession.dispose()?"

To view the discussion, visit: https://community.jboss.org/message/810189#810189

--------------------------------------------------------------
If I'm not mistaken.

Your process can either work in 2 ways.

First if the process completes without persistence (startProcess completes the entire processInstance). Hence, the ksession within the workItems are still there before dispose is called.

Second scenario is with persistence. When your process stops somewhere the current processInstanceInfo is saved. When you want to resume the process a new ksession is created and
the workItemHandlers are registered again. The processInstance can still proceed smoothly using the new ksession.
--------------------------------------------------------------

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

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