Hi all,
I use an embedded H2 db as a cache for some legacy batch jobs. It's quite 
huge (some GB) and it is needed to avoid storing data in memory. So I don't 
necessarily need persistence: I could recreate it every time I reboot my 
jvm, but I can't use the in-memory mode cause I want to obtain I/O-bound 
processing. OTOH if after a reboot the database contains valid data, I may 
reuse its contents.
I've also experimented huge performance improvements setting LOG=0 and 
FILE_LOCK=FS into the jdbc url (hence disabling the transaction log and 
changing the lock mode to java nio): so I did it, as per the scenario 
depicted above and also because my code is single threaded.

Now, I've seen that if - for external causes - the jvm exits in an 
unexpected way (OOM, manual kill and so on) *at the next reboot H2 triggers 
some sort of recovery* (I've seen a recover method that calls some 
org.h2.index.PageBtree methods).
This kind of recovery takes some time on a huge file, but sometimes at the 
end the data seems still not available (some GB of db file with no records 
at all), some other times at the end I still cannot obtain connections to 
the database.

I'd like to know if there's* a way to check for db corruption at startup 
(without waiting 5 or 10 minutes): if the database is corrupted I'd like to 
drop it entirely and create a new one*. It would be very useful having a 
way to do it simply providing the same data needed to obtain a connection 
(jdbc url, user and so on).
In other words I'd need a way to execute a DROP ALL OBJECTS DELETE FILES on 
a corrupted database, leaving at the end a fresh empty db I could still 
work on.

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


Reply via email to