Hello,
we’re using H2 in some integration tests.
We have a rather long-running setup phase that populates the database with a basic set of data that can be used for a large variety of tests.
To speed-up the integration tests, we run the setup only once, create a snapshot and restore it before each test to keep the tests fully isolated.
We basically run "SCRIPT TO '/path/to/dump.zip'" to create the snapshot and "RUNSCRIPT FROM '/path/to/dump.zip'" to restore it.
Profiling indicates that restoring the snapshot can take a significant fraction of test time, especially if the test itself is small and runs quickly.
I’m wondering if there is a more efficient way to dump and restore the H2 database?
Is it possible to access the underlying MVStore and dump it to a file/directory and later replace the MVStore with the contents of the dump?
Any hint the points me in the right direction is appreciated.
Best regards
Benedikt Waldvogel