Thank you for the response Evgenij,

On Thursday, 25 April 2019 15:46:30 UTC+2, Evgenij Ryazanov wrote:
>
> Hello. No, you can't copy a database file if database was not closed 
> properly, but you can use a SHUTDOWN command to close it.
>

Ok, so that means that closing all connections is not enough but a SHUTDOWN 
is required. Is it allowed/safe to do a SHUTDOWN while other connections 
are still active?
 

>
> However, if you need a backup copy it can be created with BACKUP TO 
> 'filename.zip' command, there is no reason to close other connections for 
> it.
>

Yes, that is the only clean way to do it and we plan to move to that 
mechanism for backups. Since our application manages hundreds of separate 
databases we currently use a deep copy of the root directory after closing 
all connections and shutting down the application.


> Usually it's safe to send a SIGTERM to a process, but it depends on your 
> database settings, there is an option that prevents H2 from automatic clean 
> shutdown on process termination.
>

Could you share with us which option that is please?
 

>
> If you can create a standalone test case that reproduces a database 
> corruption, please share it with us.
>

If only I could reproduce this at will but the behavior is intermittent. 
The process I described above is used every night and we have had about 
9-10 databases corrupted out of ~2000 during ~25 restarts. It is a rare 
event but very intrusive when it happens.

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