What is the best way to disable a job in the JDBCJobStore without deleting it's job or trigger records and without wiping the cron expression?
deleteJob(jobKey(<JobKey>, <JobGroup>)); This method will only interrupt/stop the job uniquely identified by the Job Key and Group within the scheduler which may have many other jobs running. scheduler. shutdown();
Use scheduler. pauseJob() or scheduler. pauseTrigger().
You can fire the job which has a given JobKey immediately by calling triggerJob(JobKey jobKey) of your Scheduler instance. // Create a new Job JobKey jobKey = JobKey. jobKey("myNewJob", "myJobGroup"); JobDetail job = JobBuilder. newJob(MyJob.
Here's a quick summary of the other properties which can be defined for a job instance via the JobDetail object: Durability - if a job is non-durable, it is automatically deleted from the scheduler once there are no longer any active triggers associated with it.
Use scheduler.pauseJob() or scheduler.pauseTrigger().
Alternatively you can use the following SQL script:
UPDATE QRTZ_TRIGGERS SET TRIGGER_STATE = "PAUSED"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With