If I modify the SilkierQuartz.Example to use job persistence, it runs fine the first time.
But when I run it the second time, it throws this exception:
Unhandled exception. Quartz.JobPersistenceException: Couldn't store job: Unable to store Job: 'DEFAULT.HelloJobAuto', because one already exists with this identification.
---> Quartz.ObjectAlreadyExistsException: Unable to store Job: 'DEFAULT.HelloJobAuto', because one already exists with this identification.
at Quartz.Impl.AdoJobStore.JobStoreSupport.StoreJob(ConnectionAndTransactionHolder conn, IJobDetail newJob, Boolean replaceExisting, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Quartz.Impl.AdoJobStore.JobStoreSupport.StoreJob(ConnectionAndTransactionHolder conn, IJobDetail newJob, Boolean replaceExisting, CancellationToken cancellationToken)
at Quartz.Impl.AdoJobStore.JobStoreSupport.<>c__DisplayClass152_0.<<StoreJobAndTrigger>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Quartz.Impl.AdoJobStore.JobStoreSupport.ExecuteInNonManagedTXLock[T](String lockName, Func`2 txCallback, Func`3 txValidator, Nullable`1 requestorId, CancellationToken cancellationToken)
at Quartz.Impl.AdoJobStore.JobStoreSupport.ExecuteInNonManagedTXLock[T](String lockName, Func`2 txCallback, Func`3 txValidator, Nullable`1 requestorId, CancellationToken cancellationToken)
at Quartz.Impl.AdoJobStore.JobStoreSupport.StoreJobAndTrigger(IJobDetail newJob, IOperableTrigger newTrigger, CancellationToken cancellationToken)
at Quartz.Core.QuartzScheduler.ScheduleJob(IJobDetail jobDetail, ITrigger trigger, CancellationToken cancellationToken)
at SilkierQuartz.HostedService.QuartzHostedService.StartAsync(CancellationToken cancellationToken) in C:\src\GitHub\SilkierQuartz\src\SilkierQuartz\HostedService\QuartzHostedService.cs:line 50
This is the quartz section after I modified app.config:
If I modify the
SilkierQuartz.Example
to use job persistence, it runs fine the first time.But when I run it the second time, it throws this exception:
This is the quartz section after I modified
app.config
:I'd like to be able to run Quartz more than once :)