Hello Thomas,

Thanks for your help.
We noticed that the database corruption happens fairly randomly when
the index file is deleted.
However it seems only be happening when we use option LOG=2. We used
LOG=2 option to reduce the DB start-up time (not having to recreate
the index). Unfortunately the LOG=2 option has other severe problems
that are preventing us from using it any more.

Please see my separate post with the test program.
http://groups.google.com/group/h2-database/browse_thread/thread/7c13b140b59cac36#

Thank you,
Alex




On Jan 4, 12:55 pm, "Thomas Mueller" <[email protected]>
wrote:
> Hi,
>
> > Caused by: java.lang.RuntimeException: rowcount remaining=-1
>
> MD_SEGMENTS
>        at org/h2/message/Message.getInternalError (Unknown Source)
>        at org/h2/table/TableData.addIndex (Unknown Source)
>        at org/h2/command/ddl/CreateIndex.update (Unknown Source)
>
> This looks like a database corruption. Most likely you can open the
> database using the database URL of the form jdbc:h2:~/test;RECOVER=1
> but I still have some questions, see below.
>
> > What is supposed to happen when the database is open if the index file
> > was deleted, but the transaction log contains some data referring to
> > the deleted index file ?
>
> As the indexes are re-built after opening anyway, the entries are ignored.
>
> - What is your database URL?
> - You can find out if the database is corrupted when running
>     SCRIPT TO 'test.sql'
> - What version H2 are you using? (it looks like version 1.1.102)
> - Did you use multiple connections?
> - The first workarounds is: append ;RECOVER=1 to the database URL.
>     Does it work when you do this?
> - The second workarounds is: delete the index.db file
>     (it is re-created automatically) and try again. Does it work when
> you do this?
> - The third workarounds is: use the tool org.h2.tools.Recover to create
>     the SQL script file, and then re-create the database using this script.
>     Does it work when you do this?
> - With which version of H2 was this database created?
>     You can find it out using:
>     select * from information_schema.settings where name='CREATE_BUILD'
> - Do you use any settings or special features (for example, the setting LOG=0,
>     or two phase commit, linked tables, cache settings)?
> - Is the application multi-threaded?
> - What operating system, file system, and virtual machine
>     (java -version) do you use?
> - How big is the database (file sizes)?
> - Is the database usually closed normally, or is process terminated forcefully
>     or the computer switched off?
> - Is it possible to reproduce this problem using a fresh database
>     (sometimes, or always)?
> - Are there any other exceptions (maybe in the .trace.db file)?
>     Could you send them please?
> - Do you still have any .trace.db files, and if yes could you send them?
> - Could you send the .data.db file where this exception occurs?
>
> > 1. backup your files (don't skip this step)
> > 2. delete the index file
>
> Sure, this is a good idea
>
> > 3. delete the log file
>
> You shouldn't do this, because you will lose committed transactions,
> and because it will leave the database in an inconsistent state.
>
> Regards,
> Thomas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to