You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gus <gu...@gmx.net> on 2002/09/26 11:54:27 UTC

Scheduled Jobs

Hi!

In my struts app I have to do some cleanup jobs in my database that I 
like to start regularly. What's the best way to realize such schedules 
jobs in a struts app?

Thanks in advance.

   gus


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Scheduled Jobs

Posted by James Mitchell <jm...@telocity.com>.
On the windoze side, you can use Scheduled Tasks.

>From there just point to a .bat file and you are free to do anything your
little heart desires.



James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta




> -----Original Message-----
> From: Eddie Bush [mailto:ekbush@swbell.net]
> Sent: Thursday, September 26, 2002 11:25 AM
> To: Struts Users Mailing List
> Subject: Re: Scheduled Jobs
>
>
> Personally, I'd use cron.  If you're not on a Un*x box then that's not
> an option - I would think Windoze would provide something analagous
> though ...
>
> The process cron kicks off could be any executable file, so you aren't
> even tied to doing it in Java.  For my $0.02, you could probably whip
> together a simple Perl script that did what you needed, and save some
> overhead.
>
> gus wrote:
>
> > Hi!
> >
> > In my struts app I have to do some cleanup jobs in my database that I
> > like to start regularly. What's the best way to realize such schedules
> > jobs in a struts app?
> >
> > Thanks in advance.
> >
> >   gus
>
>
> --
> Eddie Bush
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Scheduled Jobs

Posted by Eddie Bush <ek...@swbell.net>.
Personally, I'd use cron.  If you're not on a Un*x box then that's not 
an option - I would think Windoze would provide something analagous 
though ...

The process cron kicks off could be any executable file, so you aren't 
even tied to doing it in Java.  For my $0.02, you could probably whip 
together a simple Perl script that did what you needed, and save some 
overhead.

gus wrote:

> Hi!
>
> In my struts app I have to do some cleanup jobs in my database that I 
> like to start regularly. What's the best way to realize such schedules 
> jobs in a struts app?
>
> Thanks in advance.
>
>   gus 


-- 
Eddie Bush




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Scheduled Jobs

Posted by avinash <av...@inspira.com>.
hello gus,
                you can find my resume as attachment for the jobs you are
looking at ;-)


----- Original Message -----
From: "gus" <gu...@gmx.net>
To: <st...@jakarta.apache.org>
Sent: Thursday, September 26, 2002 3:24 PM
Subject: Scheduled Jobs


> Hi!
>
> In my struts app I have to do some cleanup jobs in my database that I
> like to start regularly. What's the best way to realize such schedules
> jobs in a struts app?
>
> Thanks in advance.
>
>    gus
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Scheduled Jobs

Posted by Dariusz Wojtas <dw...@myrealbox.com>.
Hi,

you may define some thread to be started while the app init process.
Works nicely for us.

Two classes are required.
1. Simple init servlet that will be plugged into web.xml
   (similar to the way that struts action servlet is plugged)
   In the 'init' method you could start your thread daemon.
   You could also pass some parameters this way.
   Stop the thread in the 'destroy' method.
   Because this solution works with threads, I would advise to
   put some flag there if it has already been started or not, to make
   sure there is only 1 instance of your thread.

2. The thread class.
   It could be parametrized (see above), for example JNDI resource
   name for database, interval, etc ...

We sceptic about such solution, but it really works nicely when we
tried it.

Another solution.
You could create some servlet that does cleanup job,
and periodically call it with cron.
I would advise 'curl' as your http client - works on Unixes and
Windows. It's very nice, free, single file program.
That solution is platform dependent, ie. different way of configuring
cron, and different versions of your http client are required.

Is anybody using different solution?

Darek


Thursday, September 26, 2002, 11:54:27 AM, you wrote:
g> Hi!
g> In my struts app I have to do some cleanup jobs in my database that I
g> like to start regularly. What's the best way to realize such schedules 
g> jobs in a struts app?

g> Thanks in advance.

g>    gus


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>