You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The static StepSynchronizationManager.manager keeps state in such a way that it becomes impossible to run at the same time two steps belonging to different jobs but where:
a) the jobs have the same id,
b) the steps have the same name and
c) the steps have the same id.
This situation may arise if more than one repository is in use (or there is one repository, but it uses different data sources at the same time).
Spring batch doesn't support multiple job repositories (or 1 repository with shifting data source) in the same JVM
With Spring Batch, you define a job and tell it which job repository it should use to report its meta-data. So what does "support multiple job repositories" specifically mean related to this? Nothing prevents you from creating multiple JobRepository beans in the same (or different) application context(s) running in the same JVM. Telling each job which job repository it should use for reporting is a matter of configuration.
And what do you mean by "1 repository with shifting data source"?
different jobs but where: a) the jobs have the same id
How could two different jobs have the same id?
This situation may arise if more than one repository is in use
The idea of using a central shared job repository is to prevent creating duplicate jobs in a clustered environment. Using two or more repositories goes against this initial goal.
(or there is one repository, but it uses different data sources at the same time).
How is this even possible?
I'm closing this issue for now because the problem is not clear to me (even after reading the gist and the SO thread). Please elaborate by providing more details and a valid use case and we can discuss further.
Gustavo Lopes opened BATCH-2476 and commented
The static StepSynchronizationManager.manager keeps state in such a way that it becomes impossible to run at the same time two steps belonging to different jobs but where:
a) the jobs have the same id,
b) the steps have the same name and
c) the steps have the same id.
This situation may arise if more than one repository is in use (or there is one repository, but it uses different data sources at the same time).
See the linked StackOverflow thread for more details. The problem can be reproduced with https://gist.github.com/cataphract/6b0619a2e28ec3b36739
Affects: 3.0.6
Reference URL: http://stackoverflow.com/a/35544379/127724
The text was updated successfully, but these errors were encountered: