On 2012-03-27 00:06, steve.ebersole wrote:
>
> Note that this is NOT using H2 JTA/XA support. It is simply using H2
> connections obtained via DriverManager wrapped in an Enhydra
> DataSource. The url is 'jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE'.
>
> Anyone see anything obvious? If it weren't for the
> 'DB_CLOSE_DELAY=-1', I would think the problem was the data cache
> being dropped across the multiple connections. That or somehow the
> commit call on the connection is not being handled properly.
>
Do you realise your URL says to __negative__ one seconds for the close
delay?
That means that the moment that the last connection closes, the DB will
be destroyed.
I think you should be using __positive__ one seconds, and I've added
some code to the next version of H2 to catch such mistakes i.e.
DB_CLOSE_DELAY must be >= 0
By default, closing the last connection to a database closes the database. For an in-memory database, this means the content is lost. To keep the database open, add;DB_CLOSE_DELAY=-1to the database URL. To keep the content of an in-memory database as long as the virtual machine is alive, usejdbc:h2:mem:test;DB_CLOSE_DELAY=-1
--
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/-/kYET7JiZTakJ.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.