Quartz.NET 2.6 – Multiple Triggers Same Class Library

Home / c# / Quartz.NET 2.6 – Multiple Triggers Same Class Library

Question:
I really don’t know if this is possible in Quartz.net but I was developing a class library to be registered in quartz.net as a crontrigger. This class library has two functions:
It will read a table in a sql server db named DBx if the triggergroup is equal to the value "internal". This should occur every 1 minute.

It will read a table in a sql server db named DBy if the triggergroup is equal to the value "external". This should occur every Mon-Fri from 8am to 5pm.

I created 2 jobs (2 records appeared at jobs_detail table) and 2 triggers (2 records appeared at the triggers and cron_triggers table respectively) with different schedules and with the corresponding triggergroup associated but pointing to the same dll.

What happen is that when I started the scheduler, even though they have different trigger names and job names, the "internal" job is also firing the "external" job even though it is not supposed to be fired unil Mon-Fri 8 to 5pm.

Is there a way to accomplish this without the need of create two classes that basically has the same code except for the fact that when they are going to read from a repository is when they will choose one DB or another based on an "internal" or an "external" parameter?


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *