我在我以前从未见过的日志中发现了这个异常,我使用的是 Hibernate 4.1.7
这是否表明我的数据库已损坏,或者这是 Hibernate 中的错误。我在http://lists.jboss.org/pipermail/hibernate-issues/2010-November/026487.html找到了对这个错误的引用,但这指的是更早版本的 hibernate 并且已针对 Hibernate 4.0 修复
org.hiorg.hibernate.HibernateException: IOException occurred reading a binary value
at org.hibernate.type.descriptor.java.DataHelper.extractBytes(DataHelper.java:187)
at org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor.wrap(PrimitiveByteArrayTypeDescriptor.java:124)
at org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor.wrap(PrimitiveByteArrayTypeDescriptor.java:41)
at org.hibernate.type.descriptor.sql.BlobTypeDescriptor$5.doExtract(BlobTypeDescriptor.java:118)
at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:65)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:269)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:265)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:238)
at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:357)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2807)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1545)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1477)
at org.hibernate.loader.Loader.getRow(Loader.java:1377)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:644)
at org.hibernate.loader.Loader.doQuery(Loader.java:854)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:293)
at org.hibernate.loader.Loader.doList(Loader.java:2382)
at org.hibernate.loader.Loader.doList(Loader.java:2368)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2198)
at org.hibernate.loader.Loader.list(Loader.java:2193)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:122)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1618)
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:374)
at com.jthink.songkong.db.SongCache.loadSongsFromDatabase(SongCache.java:57)
at com.jthink.songkong.analyse.analyser.SongGroup.getSongs(SongGroup.java:48)
at com.jthink.songkong.analyse.analyser.DiscogsSongGroupMatcher.call(DiscogsSongGroupMatcher.java:63)
at com.jthink.songkong.analyse.analyser.DiscogsSongGroupMatcher.call(DiscogsSongGroupMatcher.java:28)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: org.h2.jdbc.JdbcSQLException: IO Exception: "Missing lob entry: 5587/4" [90028-172]
at org.h2.message.DbException.convertToIOException(DbException.java:348)
at org.h2.store.LobStorageBackend$LobInputStream.fillBuffer(LobStorageBackend.java:695)
at org.h2.store.LobStorageBackend$LobInputStream.readFully(LobStorageBackend.java:668)
at org.h2.store.LobStorageBackend$LobInputStream.read(LobStorageBackend.java:654)
at org.hibernate.type.descriptor.java.DataHelper.extractBytes(DataHelper.java:179)
... 31 more
Caused by: org.h2.jdbc.JdbcSQLException: IO Exception: "Missing lob entry: 5587/4" [90028-172]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:169)
at org.h2.message.DbException.get(DbException.java:146)
at org.h2.store.LobStorageBackend.readBlock(LobStorageBackend.java:203)
at org.h2.store.LobStorageBackend$LobInputStream.fillBuffer(LobStorageBackend.java:692)
... 34 more