Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: best practice for concurrent Job

  1. #11
    Join Date
    Dec 2005
    Location
    Lyon, France
    Posts
    311

    Default

    You can see that I pass a new Date() as a parameter and so the two jobs are different. By the time the code gets to the header the first thread has had its parameters replaced by the second.
    ok with the Date parameter to create a new instance, but are the other parameters different (getExportFileName() for example)? If not, some step-scoped writers are perhaps working different things to the same file.

    It is worth mentioning that I get the stepExecution in the header and processor by implementing StepExecutionListener and use the beforeStep(StepExecution stepExecution) to set it.
    are those beans (header, processor) step-scoped? If not, they should, otherwise the job instances would indeed interfere (they'd share the exact same instances). From you configuration, only the JdbcCursorItemReader is step-scoped.

  2. #12
    Join Date
    Oct 2010
    Posts
    10

    Default

    Spot on, it was the processor not having scope="step" (the writer did I was experimenting at the time I copied into previous reply).

    The correct rows are now being written to the correct files, my footer totals are incorrect for one file but I'm sure that is another matter for me to look at.

    Thanks for all your help and your quick responses. It really makes a difference.

Posting Permissions

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