I am using apache-tomcat-6.0.10
I have 2 contexts running in my tomcat.
Both the applications need to use Quartz (1.5.1) for scheduling activities.
So when I start my tomcat, I have 2 schedulers running at the same time.
My questions are :
1)How can I optimize the usage of Quartz in this scenario?
2)Will having 2 instances of org.quartz.Scheduler produce any issues?
1.5.1 is pretty old... any reason you're sticking with it?
Either way (even with 1.5.1) your answers are:
1) If the two contexts are different applications, then it's probably most correct to have two distinct schedulers instantiated. If they're logically the same application, then you could deploy Quartz in just one of them, and then call it remotely from the other (e.g. via RMI) if you want to only have one instance. Note that because of the classloader isolation between the two contexts it would likely not work to try to somehow use the same instance in both contexts.
2) No, having 2 instances should not produce issues. (unless you are using JDBC job store and point them both at the same database tables - in which case the data will be corrupted by them -- unless you're using clustered mode). It's very common practice for even single applications to instantiate multiple schedulers.