Hi,

OK, now I'm not sure if you use the "backup" statement or not, because at
the beginning you wrote you don't ("We have a feature that backs up the H2
DB file and zips it via java. the DB is in use when we back it up (all it
does is copy the h2 file)").

If you use the "backup" statement, then the database shouldn't get corrupt.
If it does, then that would be a bug. I think we would need a reproducible
test case. If you can reproduce the issue with a new database, could you
try with H2 version 1.4.x? Version 1.4 should be more stable in this area,
because recovery is much simpler (but version 1.4 is still beta).

Regards,
Thomas







On Sunday, September 7, 2014, Ryan How <r...@exemail.com.au> wrote:

>  Pretty sure he is using the backup command.
>
>
>
>  > Here's the code:
>
>
>>    String sqlStatement = "BACKUP TO ?";
>>>>         try (Connection connection = getConnection())
>>>>         {
>>>>             try (PreparedStatement preparedStatement =
>>>> connection.prepareStatement(sqlStatement))
>>>>             {
>>>>                 preparedStatement.setString(1, fileName);
>>>>                 preparedStatement.executeUpdate();
>>>>                 if (isDebugEnabled)
>>>>                 {
>>>>                     logger.debug("BACKUP TO result completed");
>>>>                 }
>>>>             }
>>>>         }
>>>>
>>>
>
>
>  On 5/09/2014 8:46 PM, Thomas Mueller wrote:
>
> Hi,
>
>  >  to do a test after the backup and copy to make sure the database can
> be opened.
>
>  Testing a backup is a good idea in any case (even for regular backup).
> However, just opening the database will not detect some types of errors.
> You would need to do a complete read (for example using "script"). But if
> you do that, wouldn't it be simpler and faster to use the built-in online
> backup feature (the "backup" SQL statement)?
>
>  Regards,
> Thomas
>
>
>
> On Fri, Sep 5, 2014 at 9:03 AM, witerat <johndhutche...@gmail.com
> <javascript:_e(%7B%7D,'cvml','johndhutche...@gmail.com');>> wrote:
>
>> Copying an active data file creates and inconsistent image. This is
>> writes by the data  engine occur randomly throughout the file, while
>> reading from the file is done serially. Essently later writes nearer the
>> beginning of the file that the reading point of the copy operation are not
>> reflected in the copied image.
>>
>>
>> On Friday, 5 September 2014 05:02:25 UTC+12, Kam wrote:
>>>
>>> Testing the backup sounds like a good idea. thanks. Still not sure what
>>> would cause a corrupt db because if it happens while its in use, then this
>>> is not a solution but it's a start.
>>>
>>    --
>> 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
>> <javascript:_e(%7B%7D,'cvml','h2-database%2bunsubscr...@googlegroups.com');>
>> .
>> To post to this group, send email to h2-database@googlegroups.com
>> <javascript:_e(%7B%7D,'cvml','h2-database@googlegroups.com');>.
>> Visit this group at http://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> 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
> <javascript:_e(%7B%7D,'cvml','h2-database%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to h2-database@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database@googlegroups.com');>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> 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
> <javascript:_e(%7B%7D,'cvml','h2-database%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to h2-database@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','h2-database@googlegroups.com');>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to