ifs-data-layer/ifs-data-service/src/main/java/org/innovateuk/ifs/schedule/transactional/ScheduleStatusServiceImpl.java
/**
     * Requires new transaction so that the update to the schedule status table is immediate.
     * In a multi data-service scenario this will cause a failure in all but one of the services.
     */
Requires new transaction so that the update to the schedule status table is immediate.
In a multi data-service scenario this will cause a failure in all but one of the services.
Requires new transaction so that the update to the schedule status table is immediate . In a multi data - service scenario this will cause a failure in all but one of the services .
@Override
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void startJob(String jobName) {
        clearTimedOutJobs();
        Optional<ScheduleStatus> scheduleStatus = scheduleStatusRepository.findByJobName(jobName);
        if (scheduleStatus.isPresent()) {
            throw new IFSRuntimeException(String.format("Error starting job %s another service may be running.", jobName));
        }
        scheduleStatusRepository.save(new ScheduleStatus(jobName));
    }
@ Override @ Transactional ( propagation = Propagation . REQUIRES_NEW ) public void startJob ( String jobName ) { clearTimedOutJobs ( ) ; Optional < ScheduleStatus > scheduleStatus = scheduleStatusRepository . findByJobName ( jobName ) ; if ( scheduleStatus . isPresent ( ) ) { throw new IFSRuntimeException ( String . format ( "Error starting job %s another service may be running." , jobName ) ) ; } scheduleStatusRepository . save ( new ScheduleStatus ( jobName ) ) ; }
Requires new transaction so that the update to the schedule status table is immediate.
Requires new transaction so that the update to the schedule status table is immediate .