作者 RuoYi

定时任务对检查异常进行事务回滚

@@ -75,7 +75,7 @@ public class SysJobServiceImpl implements ISysJobService @@ -75,7 +75,7 @@ public class SysJobServiceImpl implements ISysJobService
75 * @param job 调度信息 75 * @param job 调度信息
76 */ 76 */
77 @Override 77 @Override
78 - @Transactional 78 + @Transactional(rollbackFor = Exception.class)
79 public int pauseJob(SysJob job) throws SchedulerException 79 public int pauseJob(SysJob job) throws SchedulerException
80 { 80 {
81 Long jobId = job.getJobId(); 81 Long jobId = job.getJobId();
@@ -95,7 +95,7 @@ public class SysJobServiceImpl implements ISysJobService @@ -95,7 +95,7 @@ public class SysJobServiceImpl implements ISysJobService
95 * @param job 调度信息 95 * @param job 调度信息
96 */ 96 */
97 @Override 97 @Override
98 - @Transactional 98 + @Transactional(rollbackFor = Exception.class)
99 public int resumeJob(SysJob job) throws SchedulerException 99 public int resumeJob(SysJob job) throws SchedulerException
100 { 100 {
101 Long jobId = job.getJobId(); 101 Long jobId = job.getJobId();
@@ -115,7 +115,7 @@ public class SysJobServiceImpl implements ISysJobService @@ -115,7 +115,7 @@ public class SysJobServiceImpl implements ISysJobService
115 * @param job 调度信息 115 * @param job 调度信息
116 */ 116 */
117 @Override 117 @Override
118 - @Transactional 118 + @Transactional(rollbackFor = Exception.class)
119 public int deleteJob(SysJob job) throws SchedulerException 119 public int deleteJob(SysJob job) throws SchedulerException
120 { 120 {
121 Long jobId = job.getJobId(); 121 Long jobId = job.getJobId();
@@ -135,7 +135,7 @@ public class SysJobServiceImpl implements ISysJobService @@ -135,7 +135,7 @@ public class SysJobServiceImpl implements ISysJobService
135 * @return 结果 135 * @return 结果
136 */ 136 */
137 @Override 137 @Override
138 - @Transactional 138 + @Transactional(rollbackFor = Exception.class)
139 public void deleteJobByIds(Long[] jobIds) throws SchedulerException 139 public void deleteJobByIds(Long[] jobIds) throws SchedulerException
140 { 140 {
141 for (Long jobId : jobIds) 141 for (Long jobId : jobIds)
@@ -151,7 +151,7 @@ public class SysJobServiceImpl implements ISysJobService @@ -151,7 +151,7 @@ public class SysJobServiceImpl implements ISysJobService
151 * @param job 调度信息 151 * @param job 调度信息
152 */ 152 */
153 @Override 153 @Override
154 - @Transactional 154 + @Transactional(rollbackFor = Exception.class)
155 public int changeStatus(SysJob job) throws SchedulerException 155 public int changeStatus(SysJob job) throws SchedulerException
156 { 156 {
157 int rows = 0; 157 int rows = 0;
@@ -173,7 +173,7 @@ public class SysJobServiceImpl implements ISysJobService @@ -173,7 +173,7 @@ public class SysJobServiceImpl implements ISysJobService
173 * @param job 调度信息 173 * @param job 调度信息
174 */ 174 */
175 @Override 175 @Override
176 - @Transactional 176 + @Transactional(rollbackFor = Exception.class)
177 public void run(SysJob job) throws SchedulerException 177 public void run(SysJob job) throws SchedulerException
178 { 178 {
179 Long jobId = job.getJobId(); 179 Long jobId = job.getJobId();
@@ -191,7 +191,7 @@ public class SysJobServiceImpl implements ISysJobService @@ -191,7 +191,7 @@ public class SysJobServiceImpl implements ISysJobService
191 * @param job 调度信息 调度信息 191 * @param job 调度信息 调度信息
192 */ 192 */
193 @Override 193 @Override
194 - @Transactional 194 + @Transactional(rollbackFor = Exception.class)
195 public int insertJob(SysJob job) throws SchedulerException, TaskException 195 public int insertJob(SysJob job) throws SchedulerException, TaskException
196 { 196 {
197 job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); 197 job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
@@ -209,7 +209,7 @@ public class SysJobServiceImpl implements ISysJobService @@ -209,7 +209,7 @@ public class SysJobServiceImpl implements ISysJobService
209 * @param job 调度信息 209 * @param job 调度信息
210 */ 210 */
211 @Override 211 @Override
212 - @Transactional 212 + @Transactional(rollbackFor = Exception.class)
213 public int updateJob(SysJob job) throws SchedulerException, TaskException 213 public int updateJob(SysJob job) throws SchedulerException, TaskException
214 { 214 {
215 SysJob properties = selectJobById(job.getJobId()); 215 SysJob properties = selectJobById(job.getJobId());