-1

I have a quartz.net scheduler.My scheduler consist of one job and three trigger. This trigger will work on minute mode and will fire every 1 minute,every 5 minute and every 10 minute.And while execute the job it will insert the data into a table. My problem is that when trigger time overlaps it will cause an exception 'violation of Primary Key constraint. Cannot insert duplicate key '. Is it possible to make my trigger to wait when they doing same job at same time.?

how can i overcome this?

svick
  • 236,525
  • 50
  • 385
  • 514
BruceWayne
  • 55
  • 5

1 Answers1

0

How do I keep a Job from firing concurrently?

Quartz.NET 2.x

Implement IJob and also decorate your job class with [DisallowConcurrentExecution] attribute. Read the API documentation for DisallowConcurrentExecutionAttribute for more information.

Quartz.NET 1.x

Make the job class implement IStatefulJob rather than IJob. Read the API documentation for IStatefulJob for more information.

http://www.quartz-scheduler.net/documentation/faq.html

Marko Lahma
  • 6,586
  • 25
  • 29