Re: single instance of background job?

2009-01-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rusty, Rusty Wright wrote: 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

Re: single instance of background job?

2009-01-12 Thread Matt Chambers
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

Re: single instance of background job?

2009-01-12 Thread Pid
Quartz has a clustering facility that makes this easy, the OpenSymphony website has more docs on this, investigate the forums/community there. org.quartz.jobStore.isClustered = true Using a JDBC JobStore with the cluster config should ensure that the job only runs once within the cluster. p

Re: single instance of background job?

2009-01-11 Thread Leon Rosenberg
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

Re: single instance of background job?

2009-01-11 Thread Rusty Wright
Ok, thanks; I'll look into terracotta. Lucas Galfaso wrote: Hi, This should be strait forward if you use terracotta. If you have a NFS that all Tomcat instances share, using FileChannel::lock is way cheaper than any other solution. -lg On Sun, Jan 11, 2009 at 2:30 AM, Rusty Wright

Re: single instance of background job?

2009-01-11 Thread Rusty Wright
That's exactly how it is now; it's on what's called our app server which is a single machine. The problem with our app server is that the developers aren't allowed access to it; the software is updated and installed by our production control/release management team. So, for example, if I

Re: single instance of background job?

2009-01-11 Thread Leon Rosenberg
Hello Rusty, On Sun, Jan 11, 2009 at 6:10 PM, Rusty Wright rusty.wri...@gmail.com wrote: The reason making it a web app appeals to me is that then I can have it log to a database, and I can tweak its configuration via a web page. And I can have a checkbox, disable/enable so I can turn it off

Re: single instance of background job?

2009-01-11 Thread Rusty Wright
Hmm, I see your point. I'll discuss it with others here and see what they think. Leon Rosenberg wrote: Hello Rusty, On Sun, Jan 11, 2009 at 6:10 PM, Rusty Wright rusty.wri...@gmail.com wrote: The reason making it a web app appeals to me is that then I can have it log to a database, and I

single instance of background job?

2009-01-10 Thread Rusty Wright
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

Re: single instance of background job?

2009-01-10 Thread Lucas Galfaso
Hi, This should be strait forward if you use terracotta. If you have a NFS that all Tomcat instances share, using FileChannel::lock is way cheaper than any other solution. -lg On Sun, Jan 11, 2009 at 2:30 AM, Rusty Wright rusty.wri...@gmail.com wrote: This isn't really a Tomcat question I'm