it would probably be much easier to make this job a separate cron process on one machine, or if it _must_ be in tomcat (why?) tie it to an ip adress or server name, so the task just checks that it can only run on tomcat1 or tomcat 10, or whatever... Otherwise you'll need to check logs on all machines to find out which run the task today.
Leon On Sun, Jan 11, 2009 at 5:30 AM, Rusty Wright <rusty.wri...@gmail.com> wrote: > This isn't really a Tomcat question I'm guessing but I don't know where else > to ask. > > In our setup we have multiple Tomcats behind a load balancer. I have a > background task that will run once a day, via Quartz. All Tomcats will be > using the same war so they will all run the job, but I need it so only one > of them runs the job. > > I'm looking for ideas for how to implement this. At the moment all I can > think of is to use a table in a database with a unique constraint on a > column, and each background process tries to insert today's date > (yyyy-mm-dd) and the one that succeeds runs the job, and the ones that > don't, do nothing. > > Thanks > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org