Announcement Announcement Module
Collapse
No announcement yet.
RunIdIncrementer holding old parameters Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RunIdIncrementer holding old parameters

    I think this is an issue with the 2.1.3 release of Spring Batch.

    I am using just a SimpleJobLauncher and the RunIdIncrementer, starting my jobs with the CommandLineJobRunner.

    For my jobs, I may choose to send in a parameter such as site=212

    java CommandLineJobRunner -next sampleJob.xml sampleJobId site=212

    or I may just leave this parameter out of the execution completely.

    java CommandLineJobRunner -next sampleJob.xml sampleJobId

    Since I upgraded to 2.1.3 I notice now that if I run the job twice with the above commands, the second execution also gets the site=212 parameter. I assume it is the RunIdIncrementer that is pulling the previous parameters and adding them to my new job execution.

    I have tested this by setting site to something different such as site=0 or by taking the -next off of the execution. Both of these cause the job to run as expected.

    I can't see in the documentation where -next is expected to cause the RunIdIncrementer to pick up parameters from the previous job run. I simply expect it to add a runId + 1 to the parameters that I provide.

    So what should be expected here? And if the expectation is that the parameters from the previous run are to carry foward (I assume this is keyed by job id??) then is there any way I can influence this functionality to only take the supplied parameters?? I'm too much of a Spring Batch novice to know where the execution parameters are picked up and set into the execution context so I don't know if I would change the SimpleJobLauncher, or the RunIdIncrementer or some other class.

    NOTE the same thing happens when there are multiple parameters on the execution. so if I have site=212 company=200 on the first run and only site=212 on the second run then the company=200 is defaulted onto the second run.
Working...
X