You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "J. Patrick Bedell" <jp...@gmail.com> on 2006/12/04 19:31:33 UTC

[offtopic] periodic cleanup task scheduling for webapp?

Hello,
   Sorry for the offtopic question!
   How might I configure my servlet container or webapp web.xml so
that a periodic application performs a cleanup task for my webapp's
database?  I want to have a cleanup application (say, a particular
java class) run periodically without triggering it on user input.
   Thanks for the help!

   Patrick

-- 
   J. Patrick Bedell
   jpbedell@gmail.com
   http://infoeng.sourceforge.net
   http://rothbardix.blogspot.com

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


Re: [offtopic] periodic cleanup task scheduling for webapp?

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/4/06, J. Patrick Bedell <jp...@gmail.com> wrote:

>    Sorry for the offtopic question!
>    How might I configure my servlet container or webapp web.xml so
> that a periodic application performs a cleanup task for my webapp's
> database?  I want to have a cleanup application (say, a particular
> java class) run periodically without triggering it on user input.

Take a look at Quartz over at OpenSymphony

   http://www.opensymphony.com/quartz/

-- 
Wendy

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


Re: [offtopic] periodic cleanup task scheduling for webapp?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Leon,

Leon Rosenberg wrote:
>> On 12/4/06, Christopher Schultz <ch...@christopherschultz.net> wrote:
>>> J. Patrick Bedell wrote:
>>> Hello,
>>>   Sorry for the offtopic question!
>>>   How might I configure my servlet container or webapp web.xml so
>>> that a periodic application performs a cleanup task for my webapp's
>>> database?  I want to have a cleanup application (say, a particular
>>> java class) run periodically without triggering it on user input.
>> 
>> Does your cleanup have to run from your webapp? If not, I would
>> recommend just using a plain-old command-line java program and schedule
>> it regularly using cron (UNIX) or whatever task scheduler is available
>> on win32.
>> 
>
> Why if i may ask?

I recommend off line batch processing for a number of reasons:

1. There is usually no reason to make it part of the webapp.
   If it's not necessary, my policy is not to do it.

2. If you have several app servers and only one database, why
   have all the app servers run database cleanup routines?

3. Why take up resources in your app server (connections, CPU time,
   etc.) that you can offload to another machine for these operations.

4. An out-of-process utility can be run from anywhere, and does not
   require the weight of a servlet container -- in case you want
   to run it standalone independently of your webapp (related to
   #2 and #3).

#1 is really my -- heh -- #1 reason not to do it. Cron is also simpler
and more reliable than an in-webapp scheduled job. It can run scheduled
processes that should have been run during downtime and it can run while
the webapp itself is down.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFdK269CaO5/Lv0PARAn0RAKCBDDZr4iit0dZo21Laf/b5nb10mwCggNKe
DYkSj/ctrdLPu1xSc9yN32I=
=T3go
-----END PGP SIGNATURE-----

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


Re: [offtopic] periodic cleanup task scheduling for webapp?

Posted by Leon Rosenberg <ro...@googlemail.com>.
On 12/4/06, Christopher Schultz <ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Patrick,
>
> J. Patrick Bedell wrote:
> > Hello,
> >   Sorry for the offtopic question!
> >   How might I configure my servlet container or webapp web.xml so
> > that a periodic application performs a cleanup task for my webapp's
> > database?  I want to have a cleanup application (say, a particular
> > java class) run periodically without triggering it on user input.
>
> Does your cleanup have to run from your webapp? If not, I would
> recommend just using a plain-old command-line java program and schedule
> it regularly using cron (UNIX) or whatever task scheduler is available
> on win32.

Why if i may ask?
Leon

>
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFdHan9CaO5/Lv0PARAvo3AJwNKCvyzyauEmj+ktFajAVlimANZQCfSLPT
> mYXmQG7UAMEvR+Qfv7o5J4o=
> =37TU
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: [offtopic] periodic cleanup task scheduling for webapp?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Patrick,

J. Patrick Bedell wrote:
> Hello,
>   Sorry for the offtopic question!
>   How might I configure my servlet container or webapp web.xml so
> that a periodic application performs a cleanup task for my webapp's
> database?  I want to have a cleanup application (say, a particular
> java class) run periodically without triggering it on user input.

Does your cleanup have to run from your webapp? If not, I would
recommend just using a plain-old command-line java program and schedule
it regularly using cron (UNIX) or whatever task scheduler is available
on win32.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFdHan9CaO5/Lv0PARAvo3AJwNKCvyzyauEmj+ktFajAVlimANZQCfSLPT
mYXmQG7UAMEvR+Qfv7o5J4o=
=37TU
-----END PGP SIGNATURE-----

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