Dear All,

when transferring large data from Oracle queries into a H2 database using 
very simple Batch Insert Statements, we eventually face reproducible 
exceptions after 20 mins of transfer:

Caused by: java.lang.IllegalStateException: *Chunk metadata too long* 
[1.4.199/3]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:894)
at org.h2.mvstore.Chunk.writeChunkHeader(Chunk.java:165)
at org.h2.mvstore.MVStore.storeNow(MVStore.java:1370)
at org.h2.mvstore.MVStore.store(MVStore.java:1233)
at org.h2.mvstore.MVStore.commit(MVStore.java:1209)
at org.h2.mvstore.MVStore.beforeWrite(MVStore.java:2480)
at org.h2.mvstore.MVMap.beforeWrite(MVMap.java:897)
at org.h2.mvstore.MVMap.operate(MVMap.java:1644)

In the result, the top exception reads like:
 
org.h2.jdbc.JdbcBatchUpdateException: File corrupted while reading record: 
"nio:/home/manticore/.manticore/ifrsbox_bak.mv.db". Possible solution: use 
the recovery tool; SQL statement:
*insert /*+PARALLEL APPEND_VALUES*/ into CFE.INSTRUMENT (ID_INSTRUMENT 
,ID_INSTRUMENT_COMMITMENT ,ID_INSTRUMENT_TYPE ,START_DATE ,END_DATE 
,ID_CURRENCY ,ID_CALENDAR ,ID_BUSINESS_DAY_CONVENTION ,DISCOUNT_CURVE 
,DISCOUNT_SPREAD)  VALUES (? ,? ,? ,? ,? ,? ,? ,? ,? ,?)*  [90030-199]
at 
org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1298)
at com.manticore.etl.ETLImportThread.writeDirect(ETLImportThread.java:423)
at com.manticore.etl.ETLImportThread.run(ETLImportThread.java:183)

org.h2.jdbc.JdbcSQLNonTransientConnectionException: File corrupted while 
reading record: "nio:/home/manticore/.manticore/ifrsbox_bak.mv.db". 
Possible solution: use the recovery tool; SQL statement:
insert /*+PARALLEL APPEND_VALUES*/ into CFE.INSTRUMENT (ID_INSTRUMENT 
,ID_INSTRUMENT_COMMITMENT ,ID_INSTRUMENT_TYPE ,START_DATE ,END_DATE 
,ID_CURRENCY ,ID_CALENDAR ,ID_BUSINESS_DAY_CONVENTION ,DISCOUNT_CURVE 
,DISCOUNT_SPREAD)  VALUES (? ,? ,? ,? ,? ,? ,? ,? ,? ,?)  [90030-199]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:617)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:194)
at 
org.h2.mvstore.db.MVTableEngine$Store.convertIllegalStateException(MVTableEngine.java:205)
at org.h2.mvstore.db.MVTable.convertException(MVTable.java:725)
at org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:202)
at org.h2.mvstore.db.MVTable.addRow(MVTable.java:546)
at org.h2.command.dml.Insert.insertRows(Insert.java:179)
at org.h2.command.dml.Insert.update(Insert.java:131)
at org.h2.command.CommandContainer.update(CommandContainer.java:133)
at org.h2.command.Command.executeUpdate(Command.java:267)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:398)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:175)
at java.lang.Thread.run(Thread.java:745)

Before this happens, around 10 similar queries have been transferred 
successfully already.
We use a recent Version 1.4.199 from GIT. It will be difficult to share the 
DB file because it is a bit large:

[manticore@ifrsbox-app ~]$ ls -lh .manticore/ifrsbox_bak.*
-rw-rw-r-- 1 manticore manticore  *51G* Aug 29 03:43 
.manticore/ifrsbox_bak.mv.db
-rw-rw-r-- 1 manticore manticore 136K Aug 29 03:21 
.manticore/ifrsbox_bak.trace.db
-rw-rw-r-- 1 manticore manticore  47K Aug 28 05:26 
.manticore/ifrsbox_bak.xml

Anything else we could do or try from out end please?
Best regards
Andreas

-- 
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 h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/6c3028e7-2d4e-4de6-acf9-d59701aeb4ef%40googlegroups.com.

Reply via email to