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.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/h2-database/-/t0QO2tu_K8oJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to