java.sql.Blob

SEVERE [global]
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.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
Caused: 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.length(Unknown Source)
        at org.hibernate.lob.SerializableBlob.length(SerializableBlob.java:31)

 

 

hibernate  的get()方法出现如上问题,原因t.commint(); 事务已经提交

用 qurey查询可以得到Blob的值``

具体原因?。。。

 

Blob 读取数据应在 从commit 之前调用。

你可能感兴趣的:(java.sql.Blob)