-->
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.  [ 2 posts ] 
Author Message
 Post subject: one-to-one error
PostPosted: Thu Oct 28, 2004 9:49 am 
Beginner
Beginner

Joined: Sun Sep 19, 2004 5:02 pm
Posts: 28
Location: Poland
Hibernate version:

2.1.6


Mapping documents:

<hibernate-mapping>
<class
name="AccountVO"
table="ACCOUNTS"
proxy="AccountVO"
dynamic-update="false"
dynamic-insert="false"
>

<id
name="ID"
column="ID"
type="long"
>
<generator class="native">
</generator>
</id>

<one-to-one
name="accountVitalInformation"
class="AccountVitalInformationVO"
cascade="none"
outer-join="auto"
constrained="false"
/>
</hibernate-mapping>

<hibernate-mapping>
<class
name="AccountVitalInformationVO"
table="ACCOUNT_VITAL_INFOS"
proxy="AccountVitalInformationVO"
dynamic-update="false"
dynamic-insert="false"
>

<id
name="ID"
column="ID"
type="long"
>
<generator class="foreign">
<param name="property">account</param>
</generator>
</id>

<one-to-one
name="account"
class="AccountVO"
cascade="none"
outer-join="auto"
constrained="true"
/>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

session.get(AccountVO.class,new Long(6))


Full stack trace of any exception that occurs:

15:12:08,218 WARN JDBCExceptionReporter:38 - SQL Error: 17027, SQLState: null
15:12:08,218 ERROR JDBCExceptionReporter:46 - Stream has been already closed
15:12:08,234 WARN JDBCExceptionReporter:38 - SQL Error: 17027, SQLState: null
15:12:08,234 ERROR JDBCExceptionReporter:46 - Stream has been already closed
net.sf.hibernate.JDBCException: could not load: [AccountVO#6]
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:422)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2117)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2018)
at net.sf.hibernate.impl.SessionImpl.get(SessionImpl.java:1927)
at Test.main(Test.java:65)
Caused by: java.sql.SQLException: Stream has been already 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:1596)
at oracle.jdbc.driver.OracleStatement.getBytesInternal(OracleStatement.java:3456)
at oracle.jdbc.driver.OracleStatement.getBytesValue(OracleStatement.java:4747)
at oracle.jdbc.driver.OracleResultSetImpl.getBytes(OracleResultSetImpl.java:632)
at oracle.jdbc.driver.OracleResultSet.getBytes(OracleResultSet.java:1650)
at net.sf.hibernate.type.BinaryType.get(BinaryType.java:63)
at net.sf.hibernate.type.SerializableType.get(SerializableType.java:33)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66)
at net.sf.hibernate.loader.Loader.hydrate(Loader.java:686)
at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:627)
at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:586)
at net.sf.hibernate.loader.Loader.getRow(Loader.java:501)
at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:213)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:281)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
... 4 more

Name and version of the database you are using:

Oracle 9i


The generated SQL (show_sql=true):

Hibernate: select accountvo0_.ID as ID1_ from ACCOUNTS accountvo0_ left outer join ACCOUNT_VITAL_INFOS accountvit1_ on accountvo0_.ID=accountvit1_.ID where accountvo0_.ID=?

_________________
Lmichasz


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 29, 2004 4:00 am 
Beginner
Beginner

Joined: Sun Sep 19, 2004 5:02 pm
Posts: 28
Location: Poland
I have tested this with MySQL database and the problem disappeared. So I think the problem is in oracle-hibernate cooperation. Currently I use Oracle9Dialect.

_________________
Lmichasz


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

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.