What I did was a little bit of extra work on top of quartz. I have a table that stores the configuration for all of my quartz jobs. When a quartz job kicks off, it will first try to update its last execute time in the table. If the last execute time is too new the update will fail and the process will exit.

I use spring-javaconfig to build my quartz configuration from this table procedurally on application startup and I provide a web and Ice API for administrators to make changes.

-Matt

Rusty Wright 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

Reply via email to