How to create multiple scheduler objects

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How to create multiple scheduler objects

popianovka
Hi All,

   My Application has a requirement to support multiple database(schemas).

          So i need to run the jobs in the scheduler more than once to support multiple schemas.Is it possible to create more than one scheduler object ?.Is it possible to execute the same job(i.e.Job in two different schedulers) more than once ?

      Help me
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=524017&messageID=615706#615706


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to create multiple scheduler objects

popianovka
I'm afraid I didn't get your requirement completely.

When you say you want to have the jobs fired multiple times ,once for each DB, do you mean to say that you'll have multiple replicated DBs with the same set of jobs replicated across the DBs?

Even if that's the case,the requirement of firing the same job on multiple scheduler instances at the same time seems little weird to me.

You would probably want to elaborate your requirement further.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=524017&messageID=615748#615748


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to create multiple scheduler objects

popianovka
Hi..,

 I will explain the requirement ...

     Now my application is triggering 10 jobs using a scheduler instance.All these 10 jobs refers to single DB. I am using jdbcJobStore to maintain job details.

      Now the requirement is to enhance this thing to work for multiple DBs. i.e.I will have multiple DBs with the same set of jobs replicated across the DBs.

      Is there any possibility to execute same set of jobs across multiple DBs?Can we use multiple scheduler instances (Each scheduler referring to a Data source(Db)) to trigger the same set of jobs multiple times.

      Hope i am clear .... Please Help me regarding this ...
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=524017&messageID=615875#615875


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to create multiple scheduler objects

popianovka
Ok.

What I still don't get is how your application (that hosts the Qrtz scheduler) is designed to interact with multiple DBs?

Would you be having one application for every DB ?

Or would you have one single application interacting concurrently with multiple DBs?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=524017&messageID=615894#615894


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to create multiple scheduler objects

popianovka
I will have single application interacting with multiple DBs.

         When user logs into the system he has to give DB name (Data source name) to connect to the application.So each user will interact to a single DB at a time.
          But the problem ia with the quartz, I will get the list of DBs from a properties file.So once the server starts i have to trigger the same set of jobs multiple times( Each set of jobs referring to a DB). Can we achieve this with multiple scheduler instances ?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=524017&messageID=615895#615895


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to create multiple scheduler objects

popianovka
In reply to this post by popianovka
I will have single application interacting with multiple DBs.

         When user logs into the system he has to give DB name (Data source name) to connect to the application.So each user will interact to a single DB at a time.
          But the problem ia with the quartz, I will get the list of DBs from a properties file.So once the server starts i have to trigger the same set of jobs multiple times( Each set of jobs referring to a DB). Can we achieve this with multiple scheduler instances ?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=524017&messageID=615899#615899


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to create multiple scheduler objects

popianovka
Assuming the jobs don't have inter-datasource dependencies,i.e. specific to the datasource they are scheduled on,you may consider having a singleton DataSource object for each DB. So if you have 5 DBs, you'll have 5 singleton DataSource objects.

You can have a factory to get this singleton datasource object. In the private constructor of the class of DataSource, you can initialize the quartz scheduler.

So each data source object will have its own scheduler instance fetching and firing jobs from its own DB.

However, you need to figure out how to dynamically pass the correct quartz.properties file to the Datasource constructor where you would initialize the quartz scheduler.Here I'm assuming that we need to have one qrtz.properties per scheduler ( i.e. per DB)

You may need to check how the quartz.props file is consumed by the qrtz framework to achieve the above.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=524017&messageID=615908#615908


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to create multiple scheduler objects

sundar
This post has NOT been accepted by the mailing list yet.
Were you able to implement this? Could you give me some pointers on how you went about it? Thank you.