tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <>
Subject Re: How to run servlet for every 30 minutes in Tomcat 4.1.30
Date Wed, 22 Dec 2004 03:57:50 GMT
Your just lending weight to what I said... Don't play with threads in a 
servlet contain unless your really sure you have to and are really sure 
you can do it safely :)

(I'm not sure I knew init() could be called more than once, certainly I 
didn't remember when I wrote that, so excellent point)

Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies

QM wrote:
> On Tue, Dec 21, 2004 at 03:37:26PM -0700, Dennis Payne wrote:
> : It is possible to create a servlet thread in the init() method.  That
> : thread sould stay alive and run something every thirty minutes.
> Yes and no. ;)
> It's possible to use a servlet's init() method for this; but per the
> spec, containers are free to initialize a servlet class as many times as
> they see fit.
> Much safer to use a ContextListener in this case, as those are triggered
> only on app (context) startup and shutdown.
> -QM

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message