H2 database error: Database may be already in use: “Locked by another process”

后端 未结 13 1131
时光取名叫无心
时光取名叫无心 2020-12-12 23:52

I am trying to use the H2 database from a Java application.

I created the database and its tables through the H2 Console and then I try to connect from Java using <

13条回答
  •  情歌与酒
    2020-12-13 00:24

    If you are running same app into multiple ports where app uses single database (h2), then add AUTO_SERVER=TRUE in the url as follows:

    jdbc:h2:file:C:/simple-commerce/price;DB_CLOSE_ON_EXIT=FALSE;AUTO_RECONNECT=TRUE;AUTO_SERVER=TRUE
    

提交回复
热议问题