我正在尝试使用 H2database 和 Spring-boot 运行应用程序。每次当我在独立的 tomcat 中重新部署应用程序时。最终显示构建失败:
Database may be already in use: "/root/NCRWalmart/walmart-pos-wits-common-configuration/src/main/wits_orch.mv.db". Possible solutions: close all other connection(s); use the server mode [90020-182]
我通过 H2databse 的官方网站并尝试了不同的解决方案,但没有任何效果对我有用。 我尝试在属性文件中使用以下 URL:
spring.datasource.url=jdbc:h2:file:${spring.config.location}/wits_orch;DB_CLOSE_ON_EXIT=true;FILE_LOCK=SOCKET;
有什么解决办法吗?
最佳答案
您可能有另一个进程同时运行相同的 H2 实例。
尝试类似 ps -ef | grep h2
,它会显示所有使用 h2*.jar 的进程
关于java - H2 数据库出现问题可能已经在使用中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37138459/