tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lauer, Oliver" <>
Subject AW: Own Threads within TC ?
Date Fri, 01 Mar 2002 16:47:11 GMT
Thanks, good to know, is it ok to reference my ServletContext within 'my'
threads ?

> AXA eSolutions GmbH
> AXA Konzern AG Germany
> Oliver Lauer 
> Web Architect
> Wörthstraße 34
> D-50668 Köln
> Germany
> Tel.: +49 221 148 31277
> Fax: +49 221 148 43963
> Mobil: +49 179 59 064 59
> e-Mail:
> _____________________________

-----Ursprüngliche Nachricht-----
Von: Craig R. McClanahan []
Gesendet: Freitag, 1. März 2002 17:42
An: Tomcat Users List
Betreff: Re: Own Threads within TC ?

On Fri, 1 Mar 2002, Lauer, Oliver wrote:

> Date: Fri, 1 Mar 2002 16:41:17 +0100
> From: "Lauer, Oliver" <>
> Reply-To: Tomcat Users List <>
> To: "Tomcat Users List (E-Mail)" <>
> Subject: Own Threads within TC ?
> Hi,
> I know within an EJB container you mustn't use threads although in some
> can either. How is that topic related to TC.
> I know I can use threads within TC but what does the spec. says about
> threads ? I want to start some within a servlet's init() and stop those
> using the destroy() method.
> Is that ok and allowed as well ?

Tomcat itself doesn't stop you from doing this (unless you run under a
security manager with a policy that prohibits thread creation).  A couple
of things to keep in mind:

* Threads should normally be created as daemon threads
  (thread.setDaemon(true) after creation).  Otherwise,
  Tomcat will hang forever at shutdown time unless your
  code correctly cleans up the threads it created.

* It is not valid to keep a reference to objects provided
  by the container (HttpServletRequest, HttpServletResponse)
  beyond the scope of a particular call to the service()
  method of your servlet.  You'll need to copy everything
  you need out of these objects before the servlet call

> Thanks
> Oliver


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

Aus Rechts- und Sicherheitsgruenden ist die in dieser E-Mail gegebene Information nicht rechtsverbindlich.
Eine rechtsverbindliche Bestaetigung reichen wir Ihnen gerne auf Anforderung in schriftlicher
Form nach. Beachten Sie bitte, dass jede Form der unautorisierten Nutzung, Veroeffentlichung,
Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail nicht gestattet ist.Diese Nachricht
 ist ausschliesslich fuer den bezeichneten Adressaten oder dessen Vertreter bestimmt. Sollten
Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein, so bitten wir
Sie, sich mit dem Absender der E-Mail in Verbindung zu setzen.
For legal and security reasons the information provided in this e-mail is not legally binding.
Upon request we would be pleased to provide you with a legally binding confirmation in written
form. Any form of unauthorised use, publication, reproduction, copying or disclosure of the
content of this e-mail is not permitted. This message is exclusively for the person addressed
or their representative. If you are not the intended recipient of this message and its contents,
please notify the sender immediately.


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message