using version 1.3.166, also tried latest 1.3.174, same behavior.
i'm running unit tests with spring. each test class sets up spring and creates a single connection to a specific h2 database file.
the first connection works fine.
using a testng @AfterClass i close the single connection. i assert that the connection is closed afterwards.
from the 2nd class on i get this exception:
java.sql.SQLException: invalid database address: jdbc:h2:file:c:\path\mydb;IFEXISTS=TRUE;ACCESS_MODE_DATA=r
the database c:\path\mydb.h2.db exists of course, otherwise the first connection would fail already.
my h2 database files are 3 to 10 GB each.
my questions:
1) how's that possible? i can't find anything on google about this exception.
2) how would one run unit tests with junit or testng and close and re-open the same db (not in-memory, not dropping)? i can't find anything about that. the manual just says when the jvm exits (which is not the case when running a test suit). or closing the last connection. what if someone opens multiple connections, how would he force a close? (i have just one connection).
3) i have tried with and without FILE_LOCK=NO. either way there are no file locks. makes sense since it's read only... but why would it not let me connect again anyway when it's read-only? can't do any harm, can it?