Spring 批量禁用元表的自动创建
Spring Batch disable automatic creation of meta tables
我正在使用 Spring Batch,我知道它可以自动创建元表。我不需要它们,我试过了:
spring.batch.initializer.enabled= false
或 spring.batch.initialize-schema: never
我总是有这个错误:
Caused by: org.postgresql.util.PSQLException: ERROR: relation "batch_job_instance" does not exist
Position : 39
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114) ~[postgresql-42.2.16.jar:42.2.16]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-3.4.5.jar:na]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-3.4.5.jar:na]
at org.springframework.jdbc.core.JdbcTemplate.doInPreparedStatement(JdbcTemplate.java:678) ~[spring-jdbc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:617) ~[spring-jdbc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
... 39 common frames omitted
I am using Spring Batch and I am aware it can do an automatic creation of the meta tables. I don't need them.
Spring Batch 不会 自动创建表,Spring Boot 会根据您的指示自动创建表。
[To turn them off] I tried : spring.batch.initializer.enabled= false or spring.batch.initialize-schema: never and I always have this error
您的属性都不正确。 属性 的名字是 spring.batch.jdbc.initialize-schema
。请检查 reference documentation.
我正在使用 Spring Batch,我知道它可以自动创建元表。我不需要它们,我试过了:
spring.batch.initializer.enabled= false
或 spring.batch.initialize-schema: never
我总是有这个错误:
Caused by: org.postgresql.util.PSQLException: ERROR: relation "batch_job_instance" does not exist
Position : 39
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164) ~[postgresql-42.2.16.jar:42.2.16]
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114) ~[postgresql-42.2.16.jar:42.2.16]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-3.4.5.jar:na]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-3.4.5.jar:na]
at org.springframework.jdbc.core.JdbcTemplate.doInPreparedStatement(JdbcTemplate.java:678) ~[spring-jdbc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:617) ~[spring-jdbc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
... 39 common frames omitted
I am using Spring Batch and I am aware it can do an automatic creation of the meta tables. I don't need them.
Spring Batch 不会 自动创建表,Spring Boot 会根据您的指示自动创建表。
[To turn them off] I tried : spring.batch.initializer.enabled= false or spring.batch.initialize-schema: never and I always have this error
您的属性都不正确。 属性 的名字是 spring.batch.jdbc.initialize-schema
。请检查 reference documentation.