I raised this question to some of my colleagues, and it seems that I consider a flaw in the spring batch admin design, which contradicts many typical spring design patterns.
The dependent spring batch admin bank “knows too much” about the context of the solution, including the data source. The problem is that in a decent web application, the data source can be dynamically determined at runtime based on a number or environment variables (environment, data center, application server) and is not as simple as Dave Sieer's approach (Mysql or HSQL). I read the posts in the spring forum , where it stands on this, however, it borders on insults on the questionnaire.
Everything is more complicated if your batch job uses several data sources (i.e. source and target databases). And it was not so simple as simply loading the data source into webapp, because all the beans associated with it were already associated with the Dave HSQL DS driver and the associated .sql files and initialization scripts.
And this led to the fact that I replaced almost every datasource bean associated with the party administration bank, including jobrepository (expected), jobExplorer, jobService and several others with a separate file in META-INF / spring / batch / override. Each file uses the spring 3.1 profile namespace to load the corresponding data source and introduces all the necessary beans.
Eddie source share