Hi,
This looks like a corrupt database. To recover the data, 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 version 1.3.171 and older: when using local temporary tables and not
dropping them manually before closing the session, and then killing the
process could result in a database that couldn't be opened.
I am very interested in analyzing and solving this problem. Corruption
problems have top priority for me. I have a few questions:
- What is your database URL?
- Did you use LOG=0 or LOG=1? Did you read the FAQ about it?
- Did the system ever run out of disk space?
- Could you send the full stack trace of the exception including message
text?
- Did you use SHUTDOWN DEFRAG or the database setting DEFRAG_ALWAYS with H2
version 1.3.159 or older?
- How many connections does your application use concurrently?
- Do you use temporary tables?
- With which version of H2 was this database created?
You can find it out using:
select * from information_schema.settings where name='CREATE_BUILD'
or have a look in the SQL script created by the recover tool.
- Did the application run out of memory (once, or multiple times)?
- Do you use any settings or special features (for example cache settings,
two phase commit, linked tables)?
- Do you use any H2-specific system properties?
- Is the application multi-threaded?
- What operating system, file system, and virtual machine
(java -version) do you use?
- How did you start the Java process (java -Xmx... and so on)?
- Is it (or was it at some point) a networked file system?
- How big is the database (file sizes)?
- How much heap memory does the Java process have?
- 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 .h2.db file where this exception occurs?
Regards,
Thomas
On Mon, Dec 16, 2013 at 8:39 PM, Ted Smith <[email protected]> wrote:
> Hello:
>
> We are running h2 1.3.170 (2012-11-30) for quite a while fine
> but suddenly we got errors
>
> org.h2.jdbc.JdbcSQLException: General error:
> "java.lang.ArrayIndexOutOfBoundsException: 0"; SQL statement:
> SELECT * FROM USER [50000-170]
>
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
> at org.h2.index.PageDataLeaf.getRowAt(PageDataLeaf.java:327)
>
> we have two tables are like this now and cannot be queried and two other
> tables are ok. It is a very small database.
>
> I am luckily able to run the recover script to recreate db (not sure if we
> list any data).
>
> the url is
>
>
> jdbc:h2:file:/database;USER=sa;PASSWORD=;AUTO_SERVER=TRUE;LOG=2;IFEXISTS=TRUE
>
> I saw some similar topics way back.
>
> Thanks
>
>
>
>
>
> --
> 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 http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
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 http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.