JBoss Community

StatefulKnowledgeSession management

created by Zeliang Huang in jBPM - View the full discussion

Hi All,

 

I have a few questions regarding StatefulKnowledgeSession.

 

I had created a class MyContextListener that extends the ServletContextListener.

This MyContextListener.java will do things like starting Mina and creating a new StatefulKnowledgeSession and not disposing it. When server starts up, I am assured that Mina server is up and there is one session active. This session is re-used for all subsequent communication with the Engine. 

 

1. Should I reuse the session for all communication with the engine?

Any other way of managing the session for better performance? From what I had tried, there ought to be at least one active session at anytime so that Human Tasks can be completed successfully.

 

2. When do I need to use JPAKnowledgeService.loadStatefulKnowledgeSession

As I am creating a new Session when the server restarts up, no previous session was actually loaded. However old process instances still flow. I don't have any rules in the process map. Is that the reason why I don't need to load a previous session in order to continue the instance? Or I am missing something by not loading the previous Session?

 

 

Any advice is welcome !

Reply to this message by going to Community

Start a new discussion in jBPM at Community