I think I have a new flavor of the Oracle "Stream has already been closed" problem. The twist in my case is that I have subclasses and hibernate adds the discriminator column to the end of the query. From what I have read in the forums with other issues related to this, the suggestion is to read the column of type long raw last in the query, but I am not sure how to do this with the disciminator value. I should note that the subclasses (for the most part) do not add any additional attributes, they only have different behaviors. So, if I could get the discriminator to appear before the long raw column, I think that would fix the issue.
I appreciate any information or suggested workarounds. I am thinking of moving the long raw column to it's own table and adding a one-to-one mapping in my base class to it. I think this will resolve the problem, but I'd appreciate any confirmation in advance.
Hibernate version:
3.0.3
Full stack trace of any exception that occurs:
Caused by: java.sql.SQLException: Stream has already been closed at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269) at oracle.jdbc.dbaccess.DBDataSetImpl.getStreamItem(DBDataSetImpl.java:1572) at oracle.jdbc.driver.OracleStatement.getBinaryStreamValue(OracleStatement.java:5396) at oracle.jdbc.driver.OracleResultSetImpl.getBinaryStream(OracleResultSetImpl.java:720) at oracle.jdbc.driver.OracleResultSet.getBinaryStream(OracleResultSet.java:1662) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getBinaryStream(NewProxyResultSet.java:726) at org.hibernate.type.BinaryType.get(BinaryType.java:37) at org.hibernate.type.SerializableType.get(SerializableType.java:34) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:77) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:68) at org.hibernate.type.AbstractType.hydrate(AbstractType.java:80) at org.hibernate.persister.entity.BasicEntityPersister.hydrate(BasicEntityPersister.java:1680) at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:958) at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:909) at org.hibernate.loader.Loader.getRow(Loader.java:822) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:297) at org.hibernate.loader.Loader.doQuery(Loader.java:395) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210) at org.hibernate.loader.Loader.loadEntity(Loader.java:1312) ... 28 more
Name and version of the database you are using:
Problem in both Oracle 8i and 10g. SQL Server is fine.
The generated SQL (show_sql=true):
*IMPLEMENTATION NOTE* EqualsFilter is a subclass of Filter, with several other subclasses (GreaterThanFilter, LessThanFilter etc). Filter has a serializable "value" attribute mapped to "value" column of the filter table.
[junit] Hibernate: select equalsfilt0_.filter_id as filter1_0_, equalsfilt0_.property as property53_0_, equalsfilt0_.value as value53_0_, equalsfilt0_.discriminator as discrimi2_0_ from filter equalsfilt0_ where equalsfilt0_.filter_id=? and equalsfilt0_.discriminator in ('EQ', 'LE', 'GE', 'LT', 'GT', 'NL', 'NE')
|