SQLException "Stream already closed" for Oracle LONG RAW in Hibernate
Issue
- When loading an entity with an Oracle
LONG RAW
type field, entity managerfind(...)
fails:
java.sql.SQLException Stream already closed.
at oracle.jdbc.driver.LongRawAccessor.getBytes(LongRawAccessor.java:162)
at oracle.jdbc.driver.OracleResultSetImpl.getBytes(OracleResultSetImpl.java:722)
at oracle.jdbc.driver.OracleResultSet.getBytes(OracleResultSet.java:402)
at org.jboss.jca.adapters.jdbc.WrappedResultSet.getBytes(WrappedResultSet.java:699)
at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:66)
...
at org.jboss.as.jpa.container.AbstractEntityManager.find(AbstractEntityManager.java:193)
- The entity for which the
find()
is executed is loaded, along with an associated entity (viaJOIN
for aManyToOne
association) - The associated entity has a
LONG RAW
field
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
- Hibernate 4
- Oracle
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.