[jboss-user] [jBPM] - Re: Problem with multiple sessions

Gareth Edwards do-not-reply at jboss.com
Mon May 27 08:24:08 EDT 2013

Gareth Edwards [https://community.jboss.org/people/garethed] created the discussion

"Re: Problem with multiple sessions"

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

Hi Maciej,

I will try and get a runnable sample together.
I have simplified my code somewhat and also as a temporary measure, I'm not disposing of sessions.

More of a problem right now is that sessions don't seem to behave correctly after loading them manually.

I can see in the database that they are being persisted (The session_info table is being populated).
After loading and registering listeners, completing a task does not invoke the next task so the session is pretty useless.

I must have be missing a bit of knowledge on session management.

I'm loading the sessions like this:

                         // Get cached knowledge base or load based on package name and version
                              kbase = packageService.getKnowledgeBase(pws.getPackageRef(), pws.getPackageVersion());
                              env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
                              StatefulKnowledgeSession session = JPAKnowledgeService.loadStatefulKnowledgeSession(pws.getId(), kbase, null, env);
                         session.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler); 
                         session.getWorkItemManager().registerWorkItemHandler("UpdateWorkflowCurrentTask", new WorkflowCurrentTaskHandler(patientWorkflowSessionService, session.getId(), user));
                         session.addEventListener(new WorkflowEventListener(patientWorkflowSessionService, session.getId(), user));


Reply to this message by going to Community

Start a new discussion in jBPM at Community

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

More information about the jboss-user mailing list