I'm testing my app in two different ways.
What could be the cause of the problem?
THis situation occurs when you configure connection to your in-memory H2 DB by default, for example: dbc:h2:mem:test
In that case DB exist until he has at least one active connection. When last connection closed, DB also closed. Depends of what you use/re-use connection (maybe pooling) and running test delays, you can get racing conditions and get unexpected results.
It can be fixed with connection parameter DB_CLOSE_DELAY=-1
, what mean db was closed only when VM died.
This is helphul link http://www.h2database.com/html/features.html#closing_a_database
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With