-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Oracle LONG RAW Problem with Subclasses and Discriminator
PostPosted: Tue Jul 19, 2005 7:21 am 
Regular
Regular

Joined: Wed Nov 17, 2004 11:49 am
Posts: 65
Location: Pittsburgh
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')


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.