wkim / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

java.lang.ArrayIndexOutOfBoundsException: 0 [50000-164] #388

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Before submitting a bug, please check the FAQ:
http://www.h2database.com/html/faq.html

What steps will reproduce the problem?
(simple SQL scripts or simple standalone applications are preferred)
1.connect to url:  jdbc:h2:~/h2dbs/calog  (see attachment file)

What is the expected output? What do you see instead?

General error: "java.lang.ArrayIndexOutOfBoundsException: 0" [50000-164] 

What version of the product are you using? On what operating system, file
system, and virtual machine?

1.3.164.  win7  

Original issue reported on code.google.com by cali...@gmail.com on 27 Mar 2012 at 9:53

GoogleCodeExporter commented 8 years ago
Is the db file broken? 
How can I fix it?

Original comment by cali...@gmail.com on 27 Mar 2012 at 9:55

GoogleCodeExporter commented 8 years ago
Hi,

Yes, the database is corrupt. There is an error message in the .trace.db file, 
but it doesn't explain why it got corrupt.

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.

I am very interested in analyzing and solving this problem. Corruption problems 
have top priority for me. I have a few questions:

- 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?

- What is your database URL?

- How many connections does your application use concurrently?

- Do you use temporary tables?

- Did you use LOG=0 or LOG=1?

- 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)?

Regards,
Thomas

Original comment by thomas.t...@gmail.com on 28 Mar 2012 at 5:16

GoogleCodeExporter commented 8 years ago

Hi, thanks for you reply. Here my answer is start with >>:

- Did the system ever run out of disk space?

>> No.

- Could you send the full stack trace of the exception including message text?

>>see 
http://groups.google.com/group/h2-database/browse_thread/thread/43abed3c6513e526

- Did you use SHUTDOWN DEFRAG or the database setting DEFRAG_ALWAYS with H2 
version 1.3.159 or older?

>>No, my H2 version is 1.3.164.

- What is your database URL?

>>jdbc:h2:~/h2dbs/calog;CACHE_SIZE=40960;LOG=0;LOCK_MODE=0;UNDO_LOG=0

- How many connections does your application use concurrently?

>> 3 threads, 3 connections.

- Do you use temporary tables?

>> No.

- Did you use LOG=0 or LOG=1?

>> I used CACHE_SIZE=40960;LOG=0;LOCK_MODE=0;UNDO_LOG=0

- Did the application run out of memory (once, or multiple times)?

>> No.

- Do you use any settings or special features (for example cache settings,
    two phase commit, linked tables)?

>> No.

- Do you use any H2-specific system properties?

>> No.

- Is the application multi-threaded?

>> Yes.

- What operating system, file system, and virtual machine
    (java -version) do you use?

>> Win7, NTFS, JDK "1.6.0_29" 32bit

- How did you start the Java process (java -Xmx... and so on)?

>> -Xmx512m -server

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

>> No.

- How big is the database (file sizes)?

>> About 10M

- How much heap memory does the Java process have?

>> 512M

- Is the database usually closed normally, or is process terminated
    forcefully or the computer switched off?

>> I killed the process and the database isn't closed normally.

- Is it possible to reproduce this problem using a fresh database
    (sometimes, or always)?

>> Almost always.

Original comment by cali...@gmail.com on 29 Mar 2012 at 4:18

GoogleCodeExporter commented 8 years ago
You have used LOG=0;LOCK_MODE=0;UNDO_LOG=0 - all of those features are very 
dangerous and can cause corrupt databases, as documented in 
http://h2database.com/html/faq.html#reliable

I'm currently working on a new storage engine that might replace the current 
one at some point (possibly in a year or so). The new storage engine should 
solve this problem (all those features would no longer be dangerous)

Original comment by thomas.t...@gmail.com on 29 Mar 2012 at 6:38