This content has been marked as final.
Show 3 replies
-
1. Re: What is the best method to trigger another thread from servlet?
valsaraj007 May 7, 2015 1:27 AM (in response to valsaraj007)I have done it by using asynchronous method in SLSB.
-
2. Re: What is the best method to trigger another thread from servlet?
jameslivingston May 8, 2015 12:04 AM (in response to valsaraj007)1 of 1 people found this helpfulThat's a good way to do it. On EE7 (so Wildfly 8+), you can use a managed executor service too.
-
3. Re: What is the best method to trigger another thread from servlet?
valsaraj007 May 8, 2015 1:04 AM (in response to jameslivingston)Thank you James!
Asynchronous method worked well in case of simple asynchronous tasks. But when I used asynchronous method which inturn calls many other methods in bean and fetch and persists entity to u[date status, it thrown EntityNotFoundException intermittently. Eg: updated entity Status to new before calling async method, inside method, it fetched that entity and updated processing and then other status updates to reflect progress in entity table. This kind of things not worked well. But for jobs like sending mail asynchronously worked fine.