[jboss-user] [jBPM] - Re: JEE + jBPM + threads

Chris Melas do-not-reply at jboss.com
Wed May 8 10:04:10 EDT 2013

Chris Melas [https://community.jboss.org/people/melc] created the discussion

"Re: JEE + jBPM + threads"

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

Whenever the process reaches a wait state, such as a timer, it will return to the point where it was called. 

If you want the code to block then you can write any custom java code (aka workitem) even use a script task that does some kind of job or simply waits for some time. This is bad practice if you use a single persistent session, since the main thread will get blocked and not be responding to any requests. If you use multiple sessions e.g. session per request, i guess it will be fine if you don't mind about persistence, since blocking tasks do not get persisted, only on a wait state persistence takes place. Can you please explain why the thread creation worries you? 

Regarding issue 2 if you need to persist state then you should use persistent session and a common approach, as shown by the jbpm-gwt-console implementation, is to have a singleton session. So in your case you could use a singleton ejb initializing the session and providing it to the ejbs with jbpm related logic. If you need to scale, you may later on add some kind of a pool of sessions in your singleton bean.

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/20130508/852f4881/attachment.html 

More information about the jboss-user mailing list