Need graceful shutdown of bootJar deployment

Hello. I used the bootJar Gradle task to create an executable jar. It runs the first time but the second time I get:

hsqldb.persist.LockFile$LockHeldExternallyException

I can get around this by removing the lock (*.lck) file. But then I get:

liquibase.lockservice   : Waiting for changelog lock....

This is not as easy to resolve because I cannot connect to the local HSQL database.

I assume these problems are because when I shut down the application (using Control-C), the application did not shut down gracefully. I also tried to kill the PID instead of Ctrl-C but no difference.

I would like a way to avoid this problem or have a way to resolve the problem when it arises. Please advise.

I am using Jmix 2.3 on a Mac. Thank you.

I would highly recommend switching to a standalone database like PostgreSQL for production builds.
Do you have any specific reason for using HSQL?

I wan’t planning to use HSQL in production. I was planning to move to Postgres. I just wanted to create a quick demo environment.

Try adding shutdown=true to the connection URL:

main.datasource.url = jdbc:hsqldb:file:.jmix/hsqldb/onboarding;shutdown=true

It will surely close the database, but it’s not recommended for Spring Boot applications.