Batch OptimisticLockingFailureException
Hi,
I am using quartz to trigger my spring batch job.I have scenario where my quartz scheduler will automatically standby mode, then while resuming its firing my spring batch job but this throwing following exception.please if any one knows about this issue keep posted here.
"org.springframework.batch.core.JobExecutionExcept ion: Flow execution ended unexpectedly
at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:105)
at org.springframework.batch.core.job.AbstractJob.exe cute(AbstractJob.java:281)
at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:120)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.batch.core.job.flow.FlowExecut ionException: Ended flow=MappingJob at state=MappingJob.RuleSetValidation with exception
at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:152)
at org.springframework.batch.core.job.flow.support.Si mpleFlow.start(SimpleFlow.java:124)
at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:99)
... 3 more
Caused by: org.springframework.dao.OptimisticLockingFailureEx ception: Attempt to update step execution id=2921 with wrong version (0), where current version is 0
at org.springframework.batch.core.repository.dao.Jdbc StepExecutionDao.updateStepExecution(JdbcStepExecu tionDao.java:185)
at org.springframework.batch.core.repository.support. SimpleJobRepository.update(SimpleJobRepository.jav a:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:183)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :150)
at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:107)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy143.update(Unknown Source)
at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:183)
at org.springframework.batch.core.job.SimpleStepHandl er.handleStep(SimpleStepHandler.java:115)
at org.springframework.batch.core.job.flow.JobFlowExe cutor.executeStep(JobFlowExecutor.java:61)
at org.springframework.batch.core.job.flow.suppor"