title: Why is spawning threads in Java EE container discouraged?
body: <p>One of the first things I've learned about Java EE development is that I shouldn't spawn my own threads inside a Java EE container. But when I come to think about it, I don't know the reason.</p>
  
  <p>Can you clearly explain why it is discouraged? </p>
  
  <p>I am sure most enterprise applications need some kind of asynchronous jobs like mail daemons, idle sessions, cleanup jobs etc.</p>
  
  <p>So, if indeed one shouldn't spawn threads, what is the correct way to do it when needed?</p>