Hi,
I'm using hibernate + spring batch to read file and store it into DB (oracle). i had written main method to create Job. I'm successfully able to load applicationContext.xml but after that it throws me following exception
In database there is no record existing. I suppose that it is having an uncommited instance in session since at the point of exception it already intialised new job instance. So i debug the code and found that it checking for end date to decide whether the job is already running or not.HTML Code:org.springframework.batch.core.repository.JobExecutionAlreadyRunningException: A job execution for this job is already running: JobInstance: id=142, JobParameters=[{}], Job=[CCXPACCodeBatchJob] at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:112) 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 $Proxy0.createJobExecution(Unknown Source) at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:98) at com.phs.ihis.batch.InitBatch.main(InitBatch.java:70)
But why it is checking for end date for the job instance created by the current execution context ...?
Am i doing something wrong ?
Regards
Gaurav


Reply With Quote