-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Disabling metadata tables in Spring Batch 5 #4383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I was able to bypass this issue by overriding DefaultBatchConfiguration's getDataSource method to return an H2 embedded database, but bringing in an embedded database for metadata purposes only seems a little suspect (compared to simply disabling the metadata functionality). E.g. public class BatchConfiguration extends DefaultBatchConfiguration {
@Override
protected DataSource getDataSource() {
return new EmbeddedDatabaseBuilder()
.addScript("classpath:org/springframework/batch/core/schema-drop-h2.sql")
.addScript("classpath:org/springframework/batch/core/schema-h2.sql")
.setType(EmbeddedDatabaseType.H2)
.build();
} |
Thank you for opening this issue. It was never possible to "disable" meta-data. A Spring Batch job requires a
In that case, you can implement I am closing this issue for now, but feel free to add a comment here if you need more support on this. |
@alexanderpkelly I just wanted to mention that we introduced a resourceless job repository implementation in 5.2.0-M2: #4679. Any feedback is welcome to improve things for the RC and then the GA in November. |
@fmbenhassine i removed @enablebatchprocessing and i configured @bean for resourcelessrepository for avoiding meta data table..but i am getting the same error @configuration } |
In previous versions of Spring Batch my team disabled metadata database creation by specifying an empty DataSource (via a no-op override of DefaultBatchConfigurer's setDataSource method). This forced the job to use a Map-based JobRepository and prevented Spring Batch from trying to create metadata tables on the Db2 database my job interacts with for it's business purposes.
This approach was deprecated and has been completely removed in Spring Batch 5. This is a conundrum for us, because Spring Batch cannot actually create these metadata tables on our Db2 data source (nor do we want it to). I can't seem to find a way to disable this functionality, which seems like it really ought to have a straightforward means of opting out of (
spring.batch.jdbc.initialize-schema=never
is seemingly not respected when a "compatible" data source is available to Spring).Is there something fundamentally wrong with my approach? Why is the metadata model creation now being forced on Spring Batch users? Should it be?
I appreciate any insight/recommendations you have. Thank you!
The text was updated successfully, but these errors were encountered: