Hi,
I need to execute my job again and again even if it is complete.
Even if i give restartable as true im getting exception.
What should be done for this?
Code:<bean id="hibernateJob" parent="simpleJob"> <!-- set restartable=false so that this job can be used by more than one test --> <property name="restartable" value="true" /> <property name="steps"> <bean id="step1" parent="skipLimitStep"> <property name="skipLimit" value="1" /> <property name="itemReader" ref="hibernateItemReader" /> <property name="itemWriter" ref="hibernateItemWriter" /> <property name="commitInterval" value="1" /> <property name="skippableExceptionClasses" value="java.lang.Exception"/> <property name="listeners" ref="stepListener" /> <property name="exceptionHandler" ref="exceptionHandler" /> <property name="allowStartIfComplete" value="true" /> </bean> </property> </bean> Exception: testLaunchJob(com.met.ib.upi.batch.test.HibernateJobFunctionalTests)org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={}{}{}{}. If you want to run this job again, change the parameters.


Reply With Quote