SQLException "Stream already closed" for Oracle LONG RAW in Hibernate
Issue
- When loading an entity with an Oracle
LONG RAWtype 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 (viaJOINfor aManyToOneassociation) - The associated entity has a
LONG RAWfield
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 of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
