[hibernate-dev] org.hibernate.ejb.test.lob.BlobTest fails on Derby

Strong Liu stliu at hibernate.org
Mon Nov 28 23:02:13 EST 2011

I just ran BlobTest on Derby, and it passes :)

btw, i'm using the latest source from master, and default hibernate.properties in hibernate-entitymanager/src/test/resource (except the db connection info changed to derby from h2)

Best Regards,

Strong Liu <stliu at hibernate.org>

On Nov 28, 2011, at 11:47 PM, Christian Bauer wrote:

> Debugging a BLOB issue on H2 (different issue than this) led me to try Derby, which fails even earlier.
> This is the same test as org.hibernate.ejb.test.lob.BlobTest, if someone could run this on Derby, you should see the exception. I've copied the test 1:1 into my environment and had the same exception.
> The sql.BlobTypeDescriptor.STREAM_BINDING option is used by default for an @Lob java.sql.Blob property. This option "unwraps" the value by calling java.BlobTypeDescriptor.unwrap():
> return (X) new BinaryStreamImpl( DataHelper.extractBytes( value.getBinaryStream() ) );
> This crashes on the call to value.getBinaryStream():
> Caused by: java.sql.SQLException: You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob's transaction has been committed or rolled back.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedBlob.checkValidity(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedBlob.getBinaryStream(Unknown Source)
> 	at org.hibernate.type.descriptor.java.BlobTypeDescriptor.unwrap(BlobTypeDescriptor.java:123)
> Bug report?
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

More information about the hibernate-dev mailing list