ms
09/19/2024, 8:30 AMDB_CLOSE_DELAY=-1
is required to keep the H2 DB open. I followed the same but no luck. This is how I’m creating
private fun Scope.getDbPath(): String = File(androidContext().dataDir, "databases").absolutePath
private fun create(dataDirPath: String): Database = Database.connect(
url = "jdbc:h2:$dataDirPath/database;DB_CLOSE_DELAY=-1",
driver = "org.h2.Driver",
setupConnection = { connection ->
connection.autoCommit = true
connection.transactionIsolation = Connection.TRANSACTION_REPEATABLE_READ
}
)