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
|