I finally got around to working on this, and ended up using the steps 
outline here 
<https://groups.google.com/forum/#!topic/h2-database/2EC0BxM9hsc>, which 
worked great for my purposes.

Using "SET EXCLUSIVE 2" and "CHECKPOINT SYNC" turns out to be necessary; 
without, I run into sporadic issues, e.g. tables not being found, missing 
triggers, etc.

There are still some things I don't quite understand, such as:

   1. Why exactly the absence of "SET EXCLUSIVE" and "CHECKPOINT SYNC" 
   occasionally results in failures? I think that I am being diligent about 
   terminating existing operations to the primary database before copying. 
   Perhaps there's no easy/obvious answer here.
   2. What exactly is the different between the "*FS" class of databases 
   and the "mem" database?
   3. Is it possible to backup and restore to a "mem" database similar to 
   "*FS" databases, e.g. with {input,output} streams? What part of the code 
   base is responsible for "mem" databases?

Thanks for the great tool :-)

Best,
Max

On Friday, June 16, 2017 at 10:43:42 AM UTC-4, Max Englander wrote:
>
> Interesting, thanks for the suggestion! 
>
> Looking through the code now I see that MVStore uses FileStore which uses 
> FilePath which maintains a publicly accessible registry of FilePath 
> implementations, where I could register, for example, a CustomFilePathMem. 
> Cool!
>
> Looking into the fs package, I see that ByteBuffer is used to pass data to 
> and from FileBase, and that, in the case of FilePathMem, data in 
> ByteBuffers makes ultimately makes its way into a byte array in 
> FileMemData. I imagine, for my purposes, that I should be able to simply 
> copy all of the underlying byte data stored in FileMemData after running my 
> liquibase migrations and then, between each test, close/open H2 and restore 
> the backed up byte data into CustomFileMemPath.
>
> Thanks, Noel!
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to