Below are responses to your questions.  It appears that adding RECOVER=1 to
the URL resolved the corrupt database issue.

Thanks for the help, let me know if you see anything with the data I'm
sending that would have caused this issue.
If there is anything else I can provide please let me know.


- Could you send the full stack trace of the exception including message
text?
The initial posting includes everything that is logged with the exception.

org.h2.jdbc.JdbcSQLException: General error: java.lang.RuntimeException:
rowcount remaining=-1 MD_SEGMENTS; SQL statement:
CREATE PRIMARY KEY ON PUBLIC.MD_SEGMENTS(SEGMENT_ID) [50000-108]
    at org/h2/message/Message.getSQLException (Unknown Source)
    at org/h2/message/Message.convert (Unknown Source)
    at org/h2/engine/MetaRecord.execute (Unknown Source)
    at org/h2/engine/Database.open (Unknown Source)
    at org/h2/engine/Database.openDatabase (Unknown Source)
    at org/h2/engine/Database.<init> (Unknown Source)
    at org/h2/engine/Engine.openSession (Unknown Source)
    at org/h2/engine/Engine.openSession (Unknown Source)
    at org/h2/engine/Engine.getSession (Unknown Source)
    at org/h2/engine/SessionFactoryEmbedded.createSession (Unknown Source)
    at org/h2/engine/SessionRemote.connectEmbeddedOrServer (Unknown Source)
    at org/h2/engine/SessionRemote.createSession (Unknown Source)
    at org/h2/jdbc/JdbcConnection.<init> (Unknown Source)
    at org/h2/jdbc/JdbcConnection.<init> (Unknown Source)
    at org/h2/Driver.connect (Unknown Source)
    at java/sql/DriverManager.getConnection (Unknown Source)
    at java/sql/DriverManager.getConnection (Unknown Source)
    at
com/videoiq/fusion/camera/storage/schema/DataSourceH2.getInitialConnection
(Unknown Source)
    at
com/videoiq/fusion/camera/storage/schema/DataSourceH2.checkRepairDatabase
(Unknown Source)
    at
com/videoiq/fusion/camera/storage/schema/DataSourceH2.makeInitialConnection
(Unknown Source)
    at com/videoiq/fusion/camera/storage/schema/DataSourceH2.start (Unknown
Source)
    at com/videoiq/fusion/camera/core/FusionDeviceMain.startup (Unknown
Source)
    at com/videoiq/fusion/camera/core/FusionDeviceMain.execute (Unknown
Source)
    at com/videoiq/fusion/camera/core/CameraLauncher.startCamera (Unknown
Source)
    at com/videoiq/fusion/camera/core/CameraLauncher.main (Unknown Source)
Caused by: java.lang.RuntimeException: rowcount remaining=-1 MD_SEGMENTS
    at org/h2/message/Message.throwInternalError (Unknown Source)
    at org/h2/table/TableData.addIndex (Unknown Source)
    at org/h2/command/ddl/CreateIndex.update (Unknown Source)
    ... 23 more

- What is your database URL?
jdbc:h2:<path to db
directory>/mddb;LOG=2;MAX_LOG_SIZE=1;DB_CLOSE_DELAY=-1;TRACE_MAX_FILE_SIZE=1

- Do you use Tomcat or another web server?
    Do you unload or reload the web application?
There is no webserver or web applications interacting with the database.
All interaction is done through straight sql commands that we've written.

- You can find out if the database is corrupted when running
    SCRIPT TO 'test.sql'


- Did you use multiple connections?
Only one connection to the database.  We have two databases and create a
single connection to both.  Only the mddb database (mentioned in the url
above) seems to be corrupted.

- The first workarounds is: append ;RECOVER=1 to the database URL.
    Does it work when you do this?
This seems to have resolved the issue.

- The second workarounds is: delete the index.db file (it is re-created
    automatically) and try again. Does it work when you do this?
This did not work when using the original database.

- 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)?
See the url above for special settings.

- Is the application multi-threaded?
- What operating system, file system, and virtual machine
    (java -version) do you use?
Linux 2.6.19, jffs2 filesystem, skelmir's siege jvm which fully supports
java 1.4.2.

- Is it (or was it at some point) a networked file system?
No.

- How big is the database (file sizes)?
total 17M
128K configdb.84.log.db  4.0K configdb.trace.db  432K mddb.481.log.db   11M
mddb.index.db
292K configdb.data.db    4.0K db.trace.db        128K mddb.482.log.db   20K
mddb.trace.db
132K configdb.index.db   1.5M mddb.480.log.db    3.3M mddb.data.db

- Is the database usually closed normally, or is process terminated
    forcefully or the computer switched off?
Both can occur, not sure which may have happened in this instance.

- Is it possible to reproduce this problem using a fresh database
    (sometimes, or always)?
No, first time we have seen this issue with the database.

- Are there any other exceptions (maybe in the .trace.db file)?
    Could you send them please?
Yes lots of exceptions in the trace.db file.
Here are a few, see the attached file for the remainder.
06-13 20:42:13 database: SET LOG 2
06-13 20:51:16 database: SET LOG 2
06-13 21:00:21 database: error initializing summary for
/usr/java/db/mddb.data.db size:5036 stage:1
java.lang.RuntimeException: Redo failure, block: 20864 expected: 127 got: 7
    at org/h2/message/Message.throwInternalError (Unknown Source)
    at org/h2/store/DiskFile.initFromSummary (Unknown Source)
    at org/h2/log/LogFile.redoOrUndo (Unknown Source)
    at org/h2/log/LogFile.redoAllGoEnd (Unknown Source)
    at org/h2/log/LogSystem.recover (Unknown Source)
    at org/h2/engine/Database.open (Unknown Source)
    at org/h2/engine/Database.openDatabase (Unknown Source)
    at org/h2/engine/Database.<init> (Unknown Source)
    at org/h2/engine/Engine.openSession (Unknown Source)
    at org/h2/engine/Engine.openSession (Unknown Source)
    at org/h2/engine/Engine.getSession (Unknown Source)
    at org/h2/engine/SessionFactoryEmbedded.createSession (Unknown Source)
    at org/h2/engine/SessionRemote.connectEmbeddedOrServer (Unknown Source)
    at org/h2/engine/SessionRemote.createSession (Unknown Source)
    at org/h2/jdbc/JdbcConnection.<init> (Unknown Source)
    at org/h2/jdbc/JdbcConnection.<init> (Unknown Source)
    at org/h2/Driver.connect (Unknown Source)
    at java/sql/DriverManager.getConnection (Unknown Source)
    at java/sql/DriverManager.getConnection (Unknown Source)
    at
com/videoiq/fusion/camera/storage/schema/DataSourceH2.getInitialConnection
(Unknown Source)
    at
com/videoiq/fusion/camera/storage/schema/DataSourceH2.checkRepairDatabase
(Unknown Source)
    at
com/videoiq/fusion/camera/storage/schema/DataSourceH2.makeInitialConnection
(Unknown Source)
    at com/videoiq/fusion/camera/storage/schema/DataSourceH2.start (Unknown
Source)
    at com/videoiq/fusion/camera/core/FusionDeviceMain.startup (Unknown
Source)
    at com/videoiq/fusion/camera/core/FusionDeviceMain.execute (Unknown
Source)
    at com/videoiq/fusion/camera/core/CameraLauncher.startCamera (Unknown
Source)
    at com/videoiq/fusion/camera/core/CameraLauncher.main (Unknown Source)
06-13 21:00:41 database: CREATE PRIMARY KEY ON
PUBLIC.MD_SEGMENTS(SEGMENT_ID)
org.h2.jdbc.JdbcSQLException: General error: java.lang.RuntimeException:
rowcount remaining=-1 MD_SEGMENTS; SQL statement:
CREATE PRIMARY KEY ON PUBLIC.MD_SEGMENTS(SEGMENT_ID) [50000-108]
    at org/h2/message/Message.getSQLException (Unknown Source)
    at org/h2/message/Message.convert (Unknown Source)
    at org/h2/engine/MetaRecord.execute (Unknown Source)
    at org/h2/engine/Database.open (Unknown Source)
    at org/h2/engine/Database.openDatabase (Unknown Source)
    at org/h2/engine/Database.<init> (Unknown Source)
    at org/h2/engine/Engine.openSession (Unknown Source)
    at org/h2/engine/Engine.openSession (Unknown Source)
    at org/h2/engine/Engine.getSession (Unknown Source)
    at org/h2/engine/SessionFactoryEmbedded.createSession (Unknown Source)
    at org/h2/engine/SessionRemote.connectEmbeddedOrServer (Unknown Source)
    at org/h2/engine/SessionRemote.createSession (Unknown Source)
    at org/h2/jdbc/JdbcConnection.<init> (Unknown Source)
    at org/h2/jdbc/JdbcConnection.<init> (Unknown Source)
    at org/h2/Driver.connect (Unknown Source)
    at java/sql/DriverManager.getConnection (Unknown Source)
    at java/sql/DriverManager.getConnection (Unknown Source)
    at
com/videoiq/fusion/camera/storage/schema/DataSourceH2.getInitialConnection
(Unknown Source)
    at
com/videoiq/fusion/camera/storage/schema/DataSourceH2.checkRepairDatabase
(Unknown Source)
    at
com/videoiq/fusion/camera/storage/schema/DataSourceH2.makeInitialConnection
(Unknown Source)
    at com/videoiq/fusion/camera/storage/schema/DataSourceH2.start (Unknown
Source)
    at com/videoiq/fusion/camera/core/FusionDeviceMain.startup (Unknown
Source)
    at com/videoiq/fusion/camera/core/FusionDeviceMain.execute (Unknown
Source)
    at com/videoiq/fusion/camera/core/CameraLauncher.startCamera (Unknown
Source)
    at com/videoiq/fusion/camera/core/CameraLauncher.main (Unknown Source)
Caused by: java.lang.RuntimeException: rowcount remaining=-1 MD_SEGMENTS
    at org/h2/message/Message.throwInternalError (Unknown Source)
    at org/h2/table/TableData.addIndex (Unknown Source)
    at org/h2/command/ddl/CreateIndex.update (Unknown Source)
    ... 23 more

- Do you still have any .trace.db files, and if yes could you send them?
Yes.

- Could you send the .data.db file where this exception occurs?
If you'd like to look into the issue further and the data file would be of
use let me know.




On Sun, Jun 28, 2009 at 2:24 PM, Thomas Mueller <
[email protected]> wrote:

>
> Hi,
>
> > I am currently running on java 1.4.2 using h2 version 1.1.111.
>
> Actually you are using version 1.1.108. The last part of the error
> code is the version: [50000-108].
>
> > What does rowcount remaining=-1 mean?  Is there any way to resolve
> > this issue?
>
> This sounds like a corrupted index. I am very interested in analyzing
> and solving this problem. Corruption problems have top priority for
> me. I have a few questions:
>
> - Could you send the full stack trace of the exception including message
> text?
> - What is your database URL?
> - Do you use Tomcat or another web server?
>    Do you unload or reload the web application?
> - You can find out if the database is corrupted when running
>    SCRIPT TO 'test.sql'
> - 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?
> - Is it (or was it at some point) a networked file system?
> - 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?
>
> 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
-~----------~----~----~----~------~----~------~--~---

Attachment: mddb.trace.db
Description: Binary data

Reply via email to