tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Souther <...@souther.us>
Subject RE: How to run servlet for every 30 minutes in Tomcat 4.1.30
Date Tue, 21 Dec 2004 16:44:28 GMT
On Tue, 2004-12-21 at 11:28, Allistair Crossley wrote:
> no, and I believe doing so it bad practice. use some OS controlled timer like cron to
issue a HTTP call to your servlet. I once wrote a shell script that calls a http address on
the local machine but cannot remember how ;) if you are using oracle then you can setup this
timer thread inside the database itself. don't add a thread into your web application.
> 

I concur. It's certainly possible to write a treaded java object that
fires a command every so often but there would be no point in making
that object a servlet (servlets exist to answer client requests). 
It's also, IMHO, more aggravation than it's worth to manage your own
daemon threads in a webapp.

It would take all of 2 minutes to write a timer with crontab and wget
that could call your servlet whenever you want.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message