I've got the jbpm6 developper guide book but there is something that i don't understand.
My question is about the way in which the sessions are created.
There is a chapter explaining the manager types (with code samples).
- Singleton Runtime Manager
- Per Request Runtime Manager
- Per Process Instance Runtime Manager
---------> With the manager you get a runtime engine and with this engine you get a session with engine.getKieSession();
There is also a chapter for implementing persistence and transaction. BUT the sample code for creation session is different
KieServices services = KieServices.Factory.get();
Environment newEnv = services.newEnvironment();
KieSession session = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, newEnv); ---> What about the runtime manager (which type) and environnement engine ?
there are number of ways how KieSession can be created. Recommended is via RuntimeManager as that hides quite a lot of boiler plate code required to setup persistence, various configuration etc. Although in some cases that might not be enough so direct session creation is desired and thus you can use JPAKnowledgeService to created ksession with persistence.