Solution ! Ok, I am so glad, I was able to do the backup with the following 
command sequence:

'''java
        if (FilesOnUSB.file != null) {
            //get Session from the unwrap method of our persistenceUnit 
'entityManager'
            Session session = entityManager.unwrap(Session.class);
            // Begin of a sql query n the session
            session.beginTransaction();
            // create data consistent call of backup command of h2 and 
execute it directly
            session.createSQLQuery("BACKUP TO 
\'/media/usb/erestau.zip\'").executeUpdate();
            // finalize sql query, flush session
            session.getTransaction().commit();
            session = null;
        }
'''

Now the database was saved, even though it seems a perfect copy of what I 
get by my plane file copy. But this is the guaranteed way of a data 
consistent database at that time!

*This is my final question: Is this now fail safe copy which can in every 
case reproduce the state of the database at that time. What are the ways to 
enforce this?*

-- 
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