Results 1 to 3 of 3

Thread: Existing transaction detected in JobRepository.Please fix this and try again

  1. #1
    Join Date
    Sep 2011
    Posts
    6

    Default Existing transaction detected in JobRepository.Please fix this and try again

    Hi,

    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.

    Thanks,
    SanjayK
    Last edited by SanjayaK; Nov 17th, 2011 at 08:01 AM. Reason: Spelling correction

  2. #2
    Join Date
    Mar 2009
    Posts
    18

    Default

    Hello SanjayK,

    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?

    thanks,

  3. #3
    Join Date
    May 2012
    Posts
    1

    Default

    Quote Originally Posted by SanjayaK View Post
    Hi,

    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.

    Thanks,
    SanjayK
    Hi SanjayK,

    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?

    Thanks,
    Nikhil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •