Rahul Agrawal [
https://community.jboss.org/people/rahulamt] created the discussion
"Asynchronous service tasks and transactions"
To view the discussion, visit:
https://community.jboss.org/message/755652#755652
--------------------------------------------------------------
jBPM5.2 documentation states the following.
h3. 5.8.7. Multi-threading
"When a service task is reached in the process, the engine will also invoke the
handler of this service synchronously. This means that the engine will wait for the
completeWorkItem(..) method to return before continuing execution. Therefore, it is
important that your service handler executes your service asynchronously if its execution
is not instantaneous. Image for example you want to invoke an external service. Since the
delay of invoking this service remotely and waiting for the results might be too high, it
might be a good idea to invoke this service asynchronously. This means that the handler
will only invoke the service asynchronously and will notify the engine if the results are
available...."
But how to notify the engine that the execution is complete and the it can continue the
execution. The suggested way is to use completeWorkItem(..). But If i try to invoke this
in the thread that I have started, the entity manager is flushing the persistence
context.
If I explicitely flush the entity manager then for back-to-back service tasks the entity
manager is not flushed even if I explicitely say EntityManager.flush().
Please help!!
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/755652#755652]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]