On Mon, 19 Mar 2001, David Wall wrote:

> I know that in the EJB model, it's not correct that beans launch their own
> threads.
> 
> Is that also true for webapps in tomcat?  Is there a portability issue if I
> have a servlet launch it's own thread for doing application-based
> housekeeping chores, such as listening for new messages via JMS and
> POP/IMAP, or periodically cleaning up "old" database entries, etc.?
> 
> Thanks,
> David
> 
> 

There are no global restrictions in the servlet spec against starting your
own threads.  However, you might want to be aware of the following issues:

* Some servlet containers (such as Tomcat as an option) can run webapps
  under a Java security manager, and they may have been configured to not
  allow webapps to start threads.

* It is likely that most J2EE-compatible application servers will have the
  ability to restrict threads, and may impose mandatory restrictions.  Be
  sure you check the docs on the platform(s) you are planning to deploy
  your app on.

Craig McClanahan


Reply via email to