When a HikariCP (or any JDBC connection) is closed, the entire database is deleted, as explained in this article:
The thing is, JDBC does not track DB connections by default. Every time you call for (jdbc/*) function, you create a new connection, perform an operation and close it. For such persistent data storages like Postgres or MySQL that’ fine although not effective (in our project, we use HikariCP to have a pool of open connections).
But for in-memory SQLite database, closing a connection to it leads to wiping the data completely out form the RAM. So you need to track the connection in more precision way. You will create a connection by yourself and close it when the work is done.
In HikariCP, a connection is open for the duration of the maxLifetime property, after which it is closed and removed, thus deleting the SQLite in-memory database. This PR fixes it by setting maxLifetime to infinity (denoted by 0) specifically for SQLite in-memory mode.
When a HikariCP (or any JDBC connection) is closed, the entire database is deleted, as explained in this article:
In HikariCP, a connection is open for the duration of the
maxLifetime
property, after which it is closed and removed, thus deleting the SQLite in-memory database. This PR fixes it by settingmaxLifetime
to infinity (denoted by0
) specifically for SQLite in-memory mode.