我有一个弹簧批处理作业,它读取,转换并写入Oracle数据库。我通过CommandLineJobRunner实用程序(使用由maven shade插件生成的fat jar +依赖项)运行作业;由于“java堆内存限制已达到”,作业随后中途失败,并且作业未标记为“失败”,而是仍显示“已启动”状态。无法重新启动Spring批处理作业
我试图用同样的工作参数(如文档建议)重新运行工作,但是这给了我这个错误:
5:24:34.147 [main] ERROR o.s.b.c.l.s.CommandLineJobRunner - Job Terminated in error: A job execution for this job is already running: JobInstance: id=1, version=0, Job=[maskTableJob]
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException:一JobInstance:id = 1,version = 0,Job = [maskTableJob] at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:120)〜[我已经尝试了各种各样的东西(比如手动的s(s))。将状态设置为FAILED,使用-restart参数)但无济于事。有没有什么我在这里失踪,因为我认为春季批次的一个优点是它能够重新开始他们离开的工作.... !!?
重新运行该作业将无法使用相同的参数。将当前时间添加为重新运行的参数。请参阅http://www.mkyong.com/spring-batch/spring-batch-a-job-instance-already-exists-and-is-complete-for-parameters/。另外结帐的文档:http://docs.spring.io/spring-batch/reference/html/configureJob.html#d5e1320 –
是的,我知道,但我需要重新运行一个特定的工作,因为我希望它继续下去它离开的地方。我的工作处理TB行,可能需要几天的时间才能运行,所以我确实希望每次都从头开始重新开始该死的事情:-) –
我认为步骤中的块处理应该处理这样的事情 –