Hi, > I was discussing this very topic with somebody last night. This >sort of begs the question, if the webapp isn't supposed to start >threads of its own in general, what is the "right" way to handle these >situations (the most typical being some sort of cron thread, or any need >to kick of an asynchronous action)?
Handle by whom? The container shouldn't (and can't really) prevent it. So the responsibility is left to the app designer. If you do start threads, you need to make sure you control them and terminate them appropriately. Marking these threads as daemons is usually good, it means the JVM can terminate them in the event of an abrupt shutdown. But it's better to keep a handle to them and make sure to interrupt() and null them out when they're done or on app shutdown (e.g. a ServletContextListener#contextDestroyed event), whichever comes sooner. Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]