Walter Andresen wrote:I need to implement asynchronous processing in the web application. When a user logs in, I need to do some time consuming actions, sync it with another system, save some audit
info, etc, etc.
What I can do is to create a separate thread and execute some code, without waiting for a response. Or I can also use JMS.
Stephan van Hulst wrote:Winston, I strongly disagree.
You should always try to avoid spawning threads...
Stephan van Hulst wrote:What's important is that your application doesn't handle the creation of such threads if it runs inside an application container, because bad thread management may cause an application to start thrashing. This includes using executor services, because you're bypassing the container's own thread pool.
Stephan van Hulst wrote:Threads are resources, you should handle them the same way you handle database connections.
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earthhttps://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter