dropwizard-quartz icon indicating copy to clipboard operation
dropwizard-quartz copied to clipboard

Using @Scheduled with Quartz JDBC job store results in duplicate execution

Open alexmountney-rr opened this issue 8 years ago • 0 comments

When @Scheduled is used on a job class, that class is registered with the scheduler without a job identity or trigger identity. Quartz randomly assigns these ids. When using the JDBC store, ids persist between restarts. On restart, a new random id is assigned resulting in another entry in the DB. This results in the Job being executed multiple times in parallel.

Workaround is not to use the annotation and use scheduler.scheduleJob(jobDetail, trigger) with JobDetail and Trigger created with static identities. Would be nice if @Scheduled had the option to set identity.

alexmountney-rr avatar Apr 06 '16 15:04 alexmountney-rr