wouterdoeland
01/19/2018, 4:49 PMJdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL)
while close on exit = false is already set?
@Before
fun setupDatabase() {
Database.connect("jdbc:h2:mem:test;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1", "org.h2.Driver")
// create tables
}
@After
fun tearDownDatabase() {
transaction {
exec("SHUTDOWN;")
}
}
tapac
01/19/2018, 5:37 PMDB_CLOSE_ON_EXIT=FALSE
if you running tests (if it tests ofc) within single run.
I use same approach here : https://github.com/JetBrains/Exposed/blob/6c80f309d4409cadfd1540494683a7a197a4ab08/src/test/kotlin/org/jetbrains/exposed/sql/tests/h2/MultiDatabaseTest.ktwouterdoeland
01/20/2018, 10:23 AMtransaction
blocks, how should I do that? I thought setting the close delay to -1 would work, but it doesn't?tapac
01/21/2018, 3:51 PMafter
block