Hello,

We've been using h2 1.4.187 and got couple of these : 
Caused by: org.h2.jdbc.JdbcSQLException: IO Exception: 
"java.io.IOException: Block not found in id [1, -94, 18, -77, 18] 
[1.4.187/50]"; "lob: null table: -3 id: 631927" [90031-187]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) 
~[h2-1.4.187.jar:1.4.187]
at org.h2.message.DbException.get(DbException.java:168) 
~[h2-1.4.187.jar:1.4.187]
at org.h2.message.DbException.convertIOException(DbException.java:330) 
~[h2-1.4.187.jar:1.4.187]
at org.h2.value.ValueLobDb.getString(ValueLobDb.java:303) 
~[h2-1.4.187.jar:1.4.187]
at org.h2.jdbc.JdbcResultSet.getString(JdbcResultSet.java:302) 
~[h2-1.4.187.jar:1.4.187]
at 
org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$2.doExtract(VarcharTypeDescriptor.java:74)
 
~[na:na]
at 
org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
 
~[na:na]
at 
org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:267)
 
~[na:na]
at 
org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:263)
 
~[na:na]
at 
org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
 
~[na:na]
at 
org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:338)
 
~[na:na]
at 
org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2969)
 
~[na:na]
at 
org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.loadFromResultSet(EntityReferenceInitializerImpl.java:324)
 
~[na:na]
... 77 common frames omitted
Caused by: java.io.IOException: Block not found in id [1, -94, 18, -77, 18] 
[1.4.187/50]
at org.h2.mvstore.StreamStore$Stream.read(StreamStore.java:466) 
~[h2-1.4.187.jar:1.4.187]
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283) ~[na:1.7.0_79]
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325) ~[na:1.7.0_79]
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) ~[na:1.7.0_79]
at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[na:1.7.0_79]
at java.io.BufferedReader.fill(BufferedReader.java:154) ~[na:1.7.0_79]
at java.io.BufferedReader.read1(BufferedReader.java:205) ~[na:1.7.0_79]
at java.io.BufferedReader.read(BufferedReader.java:279) ~[na:1.7.0_79]
at org.h2.util.IOUtils.copyAndCloseInput(IOUtils.java:200) 
~[h2-1.4.187.jar:1.4.187]
at org.h2.util.IOUtils.readStringAndClose(IOUtils.java:307) 
~[h2-1.4.187.jar:1.4.187]
at org.h2.value.ValueLobDb.getString(ValueLobDb.java:293) 
~[h2-1.4.187.jar:1.4.187]
... 86 common frames omitted
Caused by: java.lang.IllegalStateException: Block 2355 not found 
[1.4.187/50]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773) 
~[h2-1.4.187.jar:1.4.187]
at org.h2.mvstore.StreamStore.getBlock(StreamStore.java:388) 
~[h2-1.4.187.jar:1.4.187]
at org.h2.mvstore.StreamStore$Stream.nextBuffer(StreamStore.java:503) 
~[h2-1.4.187.jar:1.4.187]
at org.h2.mvstore.StreamStore$Stream.read(StreamStore.java:460) 
~[h2-1.4.187.jar:1.4.187]
... 96 common frames omitted

Looks like the problem still isn't fixed in 1.4.187. 

On Monday, March 23, 2015 at 2:53:09 PM UTC+2, Joonas Pulakka wrote:
>
> Hello,
>
> According to documentation, *closing the last connection closes the 
> database* (http://www.h2database.com/html/cheatSheet.html) and *when 
> closing the database, the database is automatically compacted for up to 200 
> milliseconds *(http://www.h2database.com/html/features.html#compacting). 
> I guess these together may cause data loss & corruption when a single 
> connection is repeatedly created, data altered, connection closed, new 
> connection created, etc. -  eventually resulting in exception such as 
> "Block not found in id [1, -128, 8, 42] [1.4.186/50]" when trying to access 
> the DB. Test case here: http://www.mysticpaste.com/view/RzEhFjCXwT . 
> Version 1.3.176 (last stable) works fine with this, version 1.4.186 crashes 
> and corrupts data.
>
> The behavior can be fixed by appending ";DB_CLOSE_DELAY=-1" to the DB URL, 
> i.e. disabling autoclosing DB when last connection is closed. I though it 
> might have had something to do with 1.4's new "FS" file locking protocol (h
> ttp://www.h2database.com/html/advanced.html#file_locking_protocols), but 
> changing that to old "FILE" doesn't seem to help.
>
> Of course this is not how a DB connection is typically used - when using a 
> connection pool, this would go unnoticed - and I found this purely by 
> accident. But it's a bug anyway, isn't it?
>
> Best Regards,
> Joonas
>

-- 
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 post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to