【问题标题】:Does anybody have a complete example of this "Spring Boot w/ JPA & H2: DB file created but nothing is persisted"有没有人有这个“Spring Boot w/JPA & H2: DB file created but nothing is persisted”的完整示例
【发布时间】:2015-02-27 15:46:08
【问题描述】:

我正在尝试执行以下步骤:

Spring Boot w/ JPA & H2: DB file created but nothing is persisted

数据库已创建并填充了数据,但当应用程序结束时,数据被删除。我尝试了各种事务解决方案。

如果我能得到一个完整的例子,我会很高兴。

问候

安德斯

【问题讨论】:

标签: spring h2


【解决方案1】:

我现在正在为我的数据库使用此配置:

spring.datasource.continueOnError=true
spring.datasource.dbCreate=update
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.url: jdbc:h2:./database/database_name;AUTO_SERVER=TRUE

【讨论】:

  • 你在哪里添加这个配置?这是在 application.context 文件中吗?
  • 我将其添加到 application.properties 文件中。
猜你喜欢
  • 1970-01-01
  • 2017-01-16
  • 1970-01-01
  • 2017-02-20
  • 2020-12-09
  • 2014-06-27
  • 2014-07-21
  • 2020-05-11
  • 2016-08-08
相关资源
最近更新 更多