0

I am using spring Batch 3.0.7. Is is possible to prevent the creation of meta data table in DB.

In my application by default bellow org/springframework/batch/core/schema-mysql.sql file code is exacting by Spring Batch.

How I can prevent to execute this file so it will not create the meta data table inside production DB.

If without creation of meta data table is not possible, then how I can point to different 2 DB so, I will create the meta data table in Local DB so inside production DB any meta data table will Not create.

how we can configure in Application.properties file for 2 Different DB .

  1. one for create the meta data creatiopn DB.
  2. another is production DB where I can fetch the record.

    20:37:21.898 INFO 8280 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executing SQL script from class path resource [org/springframework/batch/core/schema-mysql.sql] 2018-03-06 20:37:25.987 INFO 8280 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executed SQL script from class path resource [org/springframework/batch/core/schema-mysql.sql] in 4089 ms. 2018-03-06 20:37:26.138 INFO 8280 --- [ main] o.s.b.a.b.JobLauncherCommandLineRunner : Running default command line with: [] 2018-03-06 20:37:26.138 INFO 8280 --- [ main] o.s.b.c.r.s.JobRepositoryFactoryBean : No database type set, using meta data indicating: MYSQL 2018-03-06 20:37:26.546 INFO 8280 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : No TaskExecutor has been set, defaulting to synchronous executor. 2018-03-06 20:37:26.693 INFO 8280 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : Job: [FlowJob: [name=job]] launched with the following parameters: [{}]

sunil
  • 41
  • 3
  • 11
  • Which version of Spring Boot are you using? Have you [looked at the reference guide](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-initialize-a-spring-batch-database)? – Stephane Nicoll Mar 06 '18 at 16:51
  • Hi Stephane I added this spring.batch.initialize-schema=never in my Application.properties file but still its creating the meta data table in my DB and I am using Spring Boot 1.4.1 – sunil Mar 07 '18 at 05:45
  • You should read the doc for the version you're using. `never` only works in 2.0 – Stephane Nicoll Mar 07 '18 at 09:30

0 Answers0