Database-Recovery on non-corrupted H2 database: Unsupported type 17

215 views
Skip to first unread message

Stefan Dangl

unread,
Apr 6, 2016, 4:15:44 AM4/6/16
to H2 Database
Hello,

we are currently using H2 on Android for accessing from multiple processes. In order to allow backups and recovery of the database in case of corruption we wrote a simple app to use the recovery-tool to backup the database.

Currently we have a database with a size of only 1.9MB, but can not dump the database using the recovery-tool.
We can although dump the database with empty tables.

The problem is this exception:

java.lang.IllegalStateException: Unsupported type 17 [1.4.191/3]
                                                                                   at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773)
                                                                                   at org.h2.mvstore.type.ObjectDataType.newType(ObjectDataType.java:166)
                                                                                   at org.h2.mvstore.type.ObjectDataType.read(ObjectDataType.java:230)
                                                                                   at org.h2.mvstore.db.TransactionStore$ArrayType.read(TransactionStore.java:1782)
                                                                                   at org.h2.mvstore.db.TransactionStore$ArrayType.read(TransactionStore.java:1749)
                                                                                   at org.h2.mvstore.Page.read(Page.java:711)
                                                                                   at org.h2.mvstore.Page.read(Page.java:195)
                                                                                   at org.h2.mvstore.MVStore.readPage(MVStore.java:1939)
                                                                                   at org.h2.mvstore.MVMap.readPage(MVMap.java:736)
                                                                                   at org.h2.mvstore.MVMap.setRootPos(MVMap.java:746)
                                                                                   at org.h2.mvstore.MVStore.openMap(MVStore.java:471)
                                                                                   at org.h2.mvstore.db.TransactionStore.<init>(TransactionStore.java:99)
                                                                                   at org.h2.mvstore.db.TransactionStore.<init>(TransactionStore.java:78)
                                                                                   at org.h2.tools.Recover.dumpMVStoreFile(Recover.java:607)
                                                                                   at org.h2.tools.Recover.process(Recover.java:345)
                                                                                   at org.h2.tools.Recover.execute(Recover.java:320)


H2 version: 1.4.191
Connection-type: Mixed mode
JDBC-Connection-String: "jdbc:h2:/storage/emulated/0/mobidat/database.h2;PAGE_SIZE=1024;CACHE_SIZE=8192;AUTO_SERVER=TRUE"

Please tell me which further infos you need.

Noel Grandin

unread,
Apr 6, 2016, 4:23:45 AM4/6/16
to h2-da...@googlegroups.com
that looks like you starting using the MVStore early on during it's history, before we stabilised it. At some point we
changed our internal representation of how we store serialised objects in tables.

Your only real solution is to go back in time to the version you used to create that database, dump it, and then restore
it into a newer version.

Stefan Dangl

unread,
Apr 6, 2016, 4:49:41 AM4/6/16
to H2 Database
I don't really understand all the details, but could it be a problem if other processes access the database at the same time?
If so, is there a way to tell H2 to not allow new connections (and close all connections except the current one)?

Noel Grandin

unread,
Apr 6, 2016, 4:51:24 AM4/6/16
to h2-da...@googlegroups.com
This has nothing to do with simultaneous access.

See the exclusive session functionality in the docs.
Reply all
Reply to author
Forward
0 new messages