我正在尝试在循环中运行少量spring-batch
个作业。一些工作成功完成。但是其他人没有,并且日志中会抛出以下异常:
<ERROR> [org.springframework.batch.core.job.AbstractJob] :Encountered fatal error executing job
org.springframework.batch.core.repository.dao.NoSuchObjectException: **Invalid JobExecution, ID <theid> not found.**
at org.springframework.batch.core.repository.dao.JdbcJobExecutionDao.updateJobExecution(JdbcJobExecutionDao.java:197)
at
applicationContext.xml具有以下配置:
<beans:bean id="jobRepository"
class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
<beans:property name="databaseType" value="POSTGRES" />
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="transactionManager" ref="transactionManager" />
<beans:property name="isolationLevelForCreate" value="ISOLATION_DEFAULT" />
</beans:bean>
<beans:bean id="jobLauncher"
class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<beans:property name="jobRepository" ref="jobRepository" />
</beans:bean>
<beans:bean id="jobExplorer" class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean">
<beans:property name="dataSource" ref="dataSource" />
</beans:bean>
<beans:bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager" >
<beans:property name="dataSource"
ref="dataSource" />
</beans:bean>