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
--------------------------------------------------------------
Hi,
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
[
https://community.jboss.org/message/816796#816796]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]