I've got a Spring/Hibernate/JUnit test set up against an in-memory H2 DB. The URL is set up like this:
dataSource.setURL("jdbc:h2:mem:gcs;MODE=MySQL;DB_CLOSE_DELAY=-1;IGNORECASE=false;INIT=RUNSCRIPT FROM 'src/sql/schema.sql'");
But it's executing the schema for each connection. I only create the DB once in my unit tests (in a @BeforeClass method), but it seems that each connection is causing it to re-execute the INIT script.
Prior to this, I didn't have DB_CLOSE_DELAY=-1, but then the DB contents were lost after each connection closed.
I'm not sure how I'm supposed to use this if this is the correct behavior.