Luckily it is only a cache, so I don't need the data.
> 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?
jdbc:h2:file:E:/n2.h2-cache/cache;MVCC=TRUE
> - Do you use Tomcat or another web server?
I use Jetty. I wrote a HTTP caching filter for Jetty that uses H2.
> Do you unload or reload the web application?
no
> - You can find out if the database is corrupted when running
> SCRIPT TO 'test.sql'
Sorry I don't understand.
> - What version H2 are you using?
1.1.117
> - Did you use multiple connections?
Yes, many.
> - 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?
I don't care about recovery, this is only a cache.
> - With which version of H2 was this database created?
> You can find it out using:
> select * from information_schema.settings where name='CREATE_BUILD'
Same, it was created yesterday.
> - Do you use any settings or special features (for example, the setting
> LOG=0, or two phase commit, linked tables, cache settings)?
No, just MVCC=TRUE.
> - Is the application multi-threaded?
Very, it's web serving.
> - What operating system, file system, and virtual machine
> (java -version) do you use?
Windows server 2003, NTFS, java version "1.5.0_19"
> - Is it (or was it at some point) a networked file system?
no
> - How big is the database (file sizes)?
total 3 gigs
-rw-r--r-- 1 fschmidt Administ 301989936 Aug 22 00:55 cache.data.db
-rw-r--r-- 1 fschmidt Administ 57876528 Aug 21 21:50 cache.index.db
drwxr-xr-x 257 fschmidt Administ 0 Aug 21 20:43 cache.lobs.db
-rw-r--r-- 1 fschmidt Administ 640899 Aug 22 02:14 cache.trace.db
> - Is the database usually closed normally, or is process terminated
> forcefully or the computer switched off?
It is rarely closed, only when restarting the service, in which case
it closes with JVM shutdown.
> - Is it possible to reproduce this problem using a fresh database
> (sometimes, or always)?
I just started using H2 a few days ago, so no.
> - 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?
That's an interesting file. Many things I need to fix. I will attach it here.
> - Could you send the .data.db file where this exception occurs?
Too big. But I can give you direct access to the machine where the
error occurred if you send me a private email. I have the database
still saved.
>> BTW to which H2 version do you recommend to upgrade now? (only
>> speaking about stability)
I would also use the latest version. Of course there is always a risk
to do that, but I think the risk is relatively low. There are many
test cases that ensure things don't break. See also the changelog at
http://www.h2database.com/html/changelog.html
Regards,
Thomas
> I was getting plenty of crash reports from my users with these errors
> ("double allocation in file"). A week ago I rolled out an update that
> used added ";LOG=2" to the URL.
Unfortunately I don't have a reproducible test case for this problem.
Anyway, I will add the following paragraph to the FAQ:
"
Some users have reported that after a power failure, the database can
sometimes not be
opened because the index file is corrupt. In that case, the index file
can be deleted
(it is automatically re-created). To avoid this, append ;LOG=2 to the
database URL.
See also: <a href="grammar.html#set_log">SET LOG</a>. This problem
will be solved
using the new 'page store' mechanism (currently experimental).
"
Regards,
Thomas