One of the first things I've learned about J2EE development is that I shouldn't spawn my own threads inside a J2EE container. But when I come to think about it, I don't the reason. Can you provide a clear explanation why it is discouraged?
I am sure most enterprise applications need some kind of asynchronous jobs like mail daemons, idle sessions cleanup jobs etc.. So, if indeed one shouldn't spawn threads, what is the correct way to do it when needed?