I've data-source properties in my application.properties, but i don't want spring batch to create meta tables in my database. Do we have a way to keep the data-source but stop spring batch from creating the meta data files.
Asked
Active
Viewed 5,114 times
1
-
Possible duplicate of [Spring-Batch without persisting metadata to database?](https://stackoverflow.com/questions/25077549/spring-batch-without-persisting-metadata-to-database) – pvpkiran Jan 29 '18 at 08:11
2 Answers
1
Add the following property in your application.properties file:
spring.batch.initialize-schema=never
This will prevent creating meta data tables in your data source. You can find more details on this here: https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-initialize-a-spring-batch-database

Mahmoud Ben Hassine
- 28,519
- 3
- 32
- 50
-
Sadly, that's now flagged as "deprecated" and, at least for me, no longer works. =( – Marvo Feb 04 '20 at 20:56
-
1The new property is `spring.batch.initialize-schema=never`. I updated the answer accordingly. – Mahmoud Ben Hassine Feb 04 '20 at 21:36
-
@MahmoudBenHassine Adding this property doesn't work for me. I still get the same error "Invalid object name BATCH_JOB_INSTANCE" – CtrlAltElite Sep 27 '20 at 22:10
0
You can switch off the database initialization explicitly by setting spring.batch.jdbc.initialize-schema
to never
, as follows:
spring.batch.jdbc.initialize-schema=never
spring:
batch:
jdbc:
initialize-schema: never

cassiomolin
- 124,154
- 35
- 280
- 359