Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 60125 invoked from network); 5 Oct 2002 10:49:10 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 5 Oct 2002 10:49:10 -0000 Received: (qmail 17170 invoked by uid 97); 5 Oct 2002 10:49:34 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 17145 invoked by uid 97); 5 Oct 2002 10:49:34 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 17133 invoked by uid 98); 5 Oct 2002 10:49:33 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-Id: <3D9EC35F.2050601@ev.co.yu> Date: Sat, 05 Oct 2002 12:47:59 +0200 From: Nikola Milutinovic Organization: EPS Elektrovojvodina User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us Mime-Version: 1.0 To: Tomcat Users List Subject: Re: I need to run a servlet periodically References: <20021005065508.19666.qmail@web21307.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Filip Rachunek wrote: > Hello, > is it possible to have a servlet in Tomcat container > which is invoked automatically each gived time period? > [e.g. each 10 minutes] And I would also need this > special servlet to access other resources of my web > application [connection pool, ...]. You're making a mistake. A Java Servlet is a Java component that responds to a web request. That's it - nothing more, nothing less, just what it is designed for. It is not designed to be a "cron job". Something like that doesn't belong to a web application - or should we say, to the web GUI part of a web application. In a full JEE application which has a web portal (like Tomcat), you would place such a "cron job" somewhere other than a web interface. I'm not sure where, I'm no expert on JEE (yet). This was like asking "can CGI script be configured to run at regular intervals?". Of course you could run a cron job that would act as a web client and send a request that would fire up that CGI or Servlet. But that is going slightly around it. And doing it at the wrong point. Web applications are request driven application and should not be twisted into something unnatural. Use a regular cron job for this. Nix. -- To unsubscribe, e-mail: For additional commands, e-mail: