Thank you for the comprehensive and thoughtful response.

1) It is true that we may have the potential to interrupt a thread in a
middle of a transaction, but it may happen of a very rare condition which
absolutely positively did not take place.

2) That is correct and we indeed do call SHUTDOWN.

3) We do make possible queries from another process when we perform
debugging/diagnostics, but we using the exact H2 version, and, this did not
take place at all throughout the life cycle of the running process.

4) DB was created with only one version, which is the latest - 1.4.200.


I am curious about the possible circumstances under which this error takes
place... Is it related to concurrent I/O?  Multi threading?


Thanks,
Meni


On Fri, Jan 24, 2020 at 5:48 PM Evgenij Ryazanov <[email protected]> wrote:

> Hello.
>
> The BACKUP command most likely is not related (if it isn't invoked by
> another process with different version of H2). But there are three
> suspicious options in your connection URL.
>
> 1. If you use the retry: subsystem, I assume that you interrupt your
> threads that perform calls into database. It's a bad practice and usually
> it leads to corruption of embedded databases (TCP clients aren't affected),
> but if you can't change your application to avoid it, it's better to use
> the newer async: file system, the retry: file system has some own problems.
>
> 2. DB_CLOSE_ON_EXIT=FALSE means that H2 will be unable to shutdown the
> database properly automatically during termination of the Java process. If
> you use this option, you must do it by yourself using the SHUTDOWN command.
> Your process must wait for its completion and it should not try to reopen
> the database after it.
>
> 3. The AUTO_SERVER=TRUE option is used to connect to the database from a
> multiple applications without a TCP server. Usually it's better and safer
> to use a normal server, but if you can't do it, you may use this option.
> But you should ensure that all applications have exactly the same version
> of H2. For example, the similar failure was reported multiple time by users
> of IntellyJ IDEA Database tool, it was shipped with H2 1.4.196 and attempts
> to mix 1.4.196 and 1.4.200 led to such corruption. Only the TCP server and
> its clients may have different versions legally. With auto server versions
> should be the same.
>
> 4. If your database was created by a some older version, it's better to
> export it into an SQL script with a SCRIPT TO 'filename.sql' command,
> create a new database with 1.4.200, and execute a RUNSCRIPT FROM
> 'filename.sql' in it to create a database that definitely doesn't inherit
> any problems from older versions.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "H2 Database" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/h2-database/M1jKZD5rXYQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/h2-database/5a0bc11a-3fb9-45fd-9883-c2bb05bf00e4%40googlegroups.com
> <https://groups.google.com/d/msgid/h2-database/5a0bc11a-3fb9-45fd-9883-c2bb05bf00e4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/CAKFq1VvKe9iqZK9KPNP6dgYDDS7UKR7bbvVkbp_5Bho4v%2BpjYg%40mail.gmail.com.

Reply via email to