Hi,
I am getting below exception when I ran same job with different job parameters through multiple threads.
I have a job which will be executed to process a file.
To process multiple files, I have used threads to execute each File in different thread. where each thread processes a Same job with different job parameters.
Can someone tell me if I need to do any changes to overcome this exception.
Or If there is a best approach to handle my scenario.
Thanks in advance for the response.
Code:org.springframework.dao.OptimisticLockingFailureException: Attempt to update step execution id=0 with wrong version (1), where current version is 2 at org.springframework.batch.core.repository.dao.MapJobExecutionDao.updateJobExecution(MapJobExecutionDao.java:93) at org.springframework.batch.core.repository.support.SimpleJobRepository.update(SimpleJobRepository.java:155) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy8.update(Unknown Source) at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:329) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:114) at com.cme.marketdata.fix2rlc.service.JobExecutorTask.execute(JobExecutorTask.java:63)


Reply With Quote