我正在尝试使用以下代码
的JobLauncher启动作业 @RestController
public class SystemController
{
static Logger logger = LoggerFactory.getLogger(SystemController.class);
JobExecution jobExecution;
@Autowired
JobLauncher jobLauncher;
@Autowired
Job job;
@RequestMapping(value ="/abccontext" ,method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public String handleResquest(@RequestBody final Data resData)
throws Exception
{
JobParameters parameters = new JobParametersBuilder().addString("date", dateFormat.format(date)).addLong("time", Long.valueOf(System.currentTimeMillis())).toJobParameters();
jobLauncher.run(job, parameters);
}
}
我在batchjob.xml中配置了具有相同ID的作业
<job id="job">
// steps
</job>
有一段时间我收到了以下错误消息msg
PreparedStatementCallback; SQL [INSERT into BATCH_JOB_INSTANCE(JOB_INSTANCE_ID,JOB_NAME,JOB_KEY,VERSION)值 (?,?,?,?)]; ORA-08177:无法序列化此事务的访问权限 ;嵌套异常是java.sql.SQLException:ORA-08177:不能 序列化此交易的访问权限
数据库:oracle 11g,
我想将隔离级别更改为READ_COMMITTED。
任何帮助都会很明显。 thnks
答案 0 :(得分:0)
您需要在作业存储库级别进行设置
<batch:job-repository
id="jobRepository"
data-source="your-dataSource"
transaction-manager="your-transactionManager"
isolation-level-for-create="READ_COMMITTED" />