【问题标题】:How can we disable the creation of meta data tables while keeping the database connection in spring boot batch?我们如何在 Spring Boot 批处理中保持数据库连接的同时禁用元数据表的创建?
【发布时间】:2018-01-29 07:58:05
【问题描述】:

我的 application.properties 中有数据源属性,但我不希望 spring batch 在我的数据库中创建元表。 我们是否有办法保留数据源但阻止 Spring Batch 创建元数据文件。

【问题讨论】:

标签: spring spring-boot spring-batch


【解决方案1】:

在您的 application.properties 文件中添加以下属性:

spring.batch.initialize-schema=never

这将防止在您的数据源中创建元数据表。你可以在这里找到更多细节:https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-initialize-a-spring-batch-database

【讨论】:

  • 遗憾的是,它现在被标记为“已弃用”,至少对我而言,不再有效。 =(
  • 新属性是spring.batch.initialize-schema=never。我相应地更新了答案。
  • @MahmoudBenHassine 添加此属性对我不起作用。我仍然收到相同的错误“无效的对象名称 BATCH_JOB_INSTANCE”
猜你喜欢
  • 1970-01-01
  • 2019-08-10
  • 2017-12-04
  • 1970-01-01
  • 1970-01-01
  • 2018-11-10
  • 2019-07-23
  • 1970-01-01
  • 2019-01-19
相关资源
最近更新 更多