Nov 17th, 2011, 07:59 AM
Existing transaction detected in JobRepository.Please fix this and try again
I am doing a migration work from spring batch 1.1.2 to spring batch 2.1.8. We have an exisitng framework with spring batch 1.1.2 which launches job in one step of parent job. It was perfectly working in 1.1.2 but i am facing error while after migration to 2.1.8 As
Existing transaction detected in JobRepository. Please fix this and try again (e.g. remove @Transactional annotations from client).
I can understand the error. Since it is not allowing to to lauch job since it gets an active transaction in JobRepository of parent job. I got one workout i set validateTransactionState attribute to false in jobRepository. So the parent job launched the child job successfully, but encounterd another problem as the child job got hanged and not even complete. The business logic of ItemWriter is just to print values of model in console.
Please guide us.
Last edited by SanjayaK; Nov 17th, 2011 at 08:01 AM.
Reason: Spelling correction
Jan 10th, 2012, 09:55 PM
I read your post, and I was interested to know how you did you implement the "launches job in one step of parent job"...
Can you actually call a new job within another job?
May 21st, 2012, 05:09 AM
Originally Posted by SanjayaK
I am in the same state as you, can you please help me to come out from?
If I set my batch size more than the number of records in table then it works fine(child job not got hanged). but if i reduce the batch size then the child job got hanged.
Do you have any solution on this?