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().