diff --git a/src/main/java/uk/gov/hmcts/juror/scheduler/service/impl/SchedulerServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/scheduler/service/impl/SchedulerServiceImpl.java index afb2a7cd..3b56b447 100644 --- a/src/main/java/uk/gov/hmcts/juror/scheduler/service/impl/SchedulerServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/scheduler/service/impl/SchedulerServiceImpl.java @@ -17,6 +17,7 @@ import org.quartz.TriggerKey; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import uk.gov.hmcts.juror.scheduler.datastore.entity.api.APIJobDetailsEntity; import uk.gov.hmcts.juror.scheduler.datastore.model.JobType; import uk.gov.hmcts.juror.scheduler.service.contracts.SchedulerService; @@ -56,6 +57,7 @@ public void preDestroy() { } @Override + @Transactional public void register(APIJobDetailsEntity jobDetails) { if (jobDetails.getCronExpression() != null) { scheduleCronJob(jobDetails); @@ -130,6 +132,7 @@ public boolean isDisabled(String jobKey) { } @Override + @Transactional public void unregister(String jobKey) { try { scheduler.deleteJob(createJobKey(jobKey));