-
1. Re: A statefulknowledgesession question
swiderski.maciej Sep 30, 2013 1:12 AM (in response to wangtrash)1 of 1 people found this helpfulit completely ok to keep session active when is needed - like in your case. For example jbpm console uses single session that is active all the time so there is no need to actually dispose it. Disposal of ksession is important if you have many instances of them.
Memory consumption will not be high as process instances are persisted in db when not executed like when being in wait state.
HTH
-
2. Re: A statefulknowledgesession question
wangtrash Oct 7, 2013 9:58 PM (in response to swiderski.maciej)Thanks for your reply. I'm a newbie. I use the jbpm in a web application. in fact, I permit users to define their processs using the designer. every time, a user need start a process, I will new a knowledgebase and then start a new statefulesession. In this case, is disposal a ksession is important?
-
3. Re: A statefulknowledgesession question
swiderski.maciej Oct 8, 2013 1:27 AM (in response to wangtrash)yes, it is important in that case as you would have many ksessions. So I would recommend for you to create some sort of mapping mechanism for the process instance and ksession so you can dispose the ksession as soon as possible (it reached wait state) and then use the right session to resume it like when completing task or signaling.
HTH
-
4. Re: A statefulknowledgesession question
wangtrash Oct 8, 2013 7:30 AM (in response to swiderski.maciej)Is that mean I must write a processeventlistener and signal to dispose the session when the main process is over?
-
5. Re: A statefulknowledgesession question
swiderski.maciej Oct 9, 2013 1:51 AM (in response to wangtrash)yes, you could do that but please note that you can't dispose it directly in the event listener as it is still using ksession and thus you would need to use transaction synchronization to dispose ksession after transaction has been completed. Take a look here as it might get helpful.
HTH