I posted this question on Stack Overflow 
<https://stackoverflow.com/questions/49216195/mvstore-online-back-up> but 
never got a response.  I just want to know if this is a reasonable way to 
do an online backup of an MVStore file and whether I'm missing anything 
important (please forgive my Java, as I am actually working in Clojure and 
don't know Java well):

// db is an MVStore instance
FileStore fs = db.getFileStore();
FileOutputStream fos = java.io.FileOutputStream(pathToBackupFile);
FileChannel outChannel = fos.getChannel();
try {
  db.commit();
  db.setReuseSpace(false);
  ByteBuffer bb = fs.readFully(0, fs.size());
  outChannel.write(bb);
}
finally {
  outChannel.close();
  db.setReuseSpace(true);
}


I tried following the docs, but certain things are vague or confusing to 
me, so I'm worried I may be doing something wrong.  Does the code above 
look okay?

-- 
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
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