Hi!

Another customer had this issue :-/

I saw that in the doc:
"Whenever data is modified in the database and those changes are committed, 
the changes are written to the transaction log (except for in-memory 
objects). The changes to the main data area itself are usually written 
later on, to optimize disk access. If there is a power failure, the main 
data area is not up-to-date, but because the changes are in the transaction 
log, the next time the database is opened, the changes are re-applied 
automatically."

Transaction logs are in the main database file?






Le lundi 4 juin 2018 11:16:58 UTC+2, Loïc Rollus a écrit :
>
> Hello,
>
> *Context:*
> I develop a software (java) with an embedded h2. This software is released 
> on multiple customers laptop (windows 7/10).
> It's not a server app but I've choosen spring boot to built as we may move 
> in the future to a client/Server app.
> H2 version is 1.4.196 and URL connection is 
> "jdbc:h2:file:db;DB_CLOSE_DELAY=-1" (it creates db.mv.db file).
>
> *Problem:*
> One customer was not able to start our app.
> Error is:
> org.h2.jdbc.JdbcSQLException: File corrupted while reading record: null. 
> Possible solution: use the recovery tool [90030-196]
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
> at org.h2.message.DbException.get(DbException.java:168)
> at 
> org.h2.mvstore.db.MVTableEngine$Store.convertIllegalStateException(MVTableEngine.java:196)
> at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:168)
> at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:100)
> ...
> Caused by: java.lang.IllegalStateException: File corrupted in chunk 11896, 
> expected page length 4..192, got 538976288 [1.4.196/6]
> at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:765)
> at org.h2.mvstore.Page.read(Page.java:649)
>
> I've try the recover tools but It doesn't work (I have the same error as 
> in the "Caused by" exception).
> "Exception in thread "main" java.lang.IllegalStateException: File 
> corrupted in chunk 11896, expected page length 4..192, got 538976288"
>
> I've looked at the customer app logs and it really looks like the computer 
> stop suddenly (low battery, hard reboot, crash...).
>
> Unfortunately it's customer data so difficult for me to post the corrupted 
> database here.
>
> How can I avoid this in the future?
> Should I use specific option? I saw that there were some dangerous options 
> like LOG=0/1, ... 
> Is DB_CLOSE_DELAY=-1 dangerous? Should I remove it for a desktop app?
> Is mv reliable? Should I use it for a simple desktop app?
> No specific solutions / mechansims I can use to make it more reliable when 
> power failure / hard customer?
>
>
> Thanks!
> Loïc
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to