Michel Zedler created DELTASPIKE-1449:
-----------------------------------------
Summary: Broken quartz annotations and duplicate job details
Key: DELTASPIKE-1449
URL: https://issues.apache.org/jira/browse/DELTASPIKE-1449
Project: DeltaSpike
Issue Type: Bug
Security Level: public (Regular issues)
Components: Scheduler
Affects Versions: 1.9.1
Reporter: Michel Zedler
This exemplary job class
{code:java}
package my.package
import org.apache.deltaspike.scheduler.api.Scheduled;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
@Scheduled(cronExpression = "...", overrideOnStartup = true)
@DisallowConcurrentExecution
public class MyJob implements Job {
...
} {code}
using deltaspike 1.9.0 results in:
{noformat}
table: QRTZ_JOB_DETAILS
row 1:
JOB_NAME = MyJob
JOB_CLASS_NAME = my.package.MyJob
IS_NONCONCURRENT = 1 (true){noformat}
using deltaspike 1.9.1 or later
+ a previously empty table results in:
{code:java}
table: QRTZ_JOB_DETAILS
row 1:
JOB_NAME = my.package.MyJob
JOB_CLASS_NAME = org.apache.deltaspike.scheduler.impl.JobAdapter
IS_NONCONCURRENT = 0 (false){code}
+ a non-empty table results in:
{code:java}
table: QRTZ_JOB_DETAILS
row 1: (inserted by a deployment using 1.9.0 or earlier)
JOB_NAME = MyJob
JOB_CLASS_NAME = my.package.MyJob
IS_NONCONCURRENT = 1 (true)
row 2:
JOB_NAME = my.package.MyJob
JOB_CLASS_NAME = org.apache.deltaspike.scheduler.impl.JobAdapter
IS_NONCONCURRENT = 0 (false){code}
I tracked this behaviour down to changes by DELTASPIKE-1369 that were released
with 1.9.1
likely causing:
(1) annotations org.quartz.DisallowConcurrentExecution and
org.quartz.PersistJobDataAfterExecution to be effectively ignored because
Quartz checks for their presence in class
org.apache.deltaspike.scheduler.impl.JobAdapter.
(2) consecutive deployments to produce duplicate jobs, triggers and concurrent
executions.
I could not find any release notes, migration guides or open bugs concerning
this topic.
Expected behaviour:
* deltaspike/quartz should update existing JobDetails instead of inserting
duplicates (the JobDetails can be matched using old JOB_CLASS_NAME and new
JOB_NAME - both are the fully qualified job class name)
* functionality of quartz annotations should be restored
I can provide more context if useful.
Are there any known workarounds?
--
This message was sent by Atlassian Jira
(v8.20.1#820001)