Hibernate version: 2.1.6
Mapping documents:<?xml version="1.0"?>
Code:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="gov.usps.sakcarrier.db.vo.PSF2734DetailRecord"
table="PSF2734_DETAILS"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="DETAIL_ID"
type="int"
unsaved-value="-1"
>
<generator class="sequence">
<param name="sequence">PSF2734DETAIL_ID_SEQ</param>
</generator>
</id>
<many-to-one
name="root"
class="gov.usps.sakcarrier.db.vo.PSF2734RootRecord"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="PSF2734ROOT_ID"
/>
<property
name="sequenceNumber"
type="int"
update="true"
insert="true"
access="property"
column="SEQUENCE_NUM"
not-null="true"
unique="false"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-PSF2734DetailRecord.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="gov.usps.sakcarrier.db.vo.PSF2734RootRecord"
table="PSF2734_ROOT"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="ROOT_ID"
type="int"
unsaved-value="-1"
>
<generator class="sequence">
<param name="sequence">PSF2734ROOT_ID_SEQ</param>
</generator>
</id>
<property
name="serialNumber"
type="string"
update="true"
insert="true"
access="property"
column="SERIAL_NUMBER"
length="9"
not-null="true"
unique="true"
/>
<set
name="details"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
sort="unsorted"
>
<key
column="PSF2734ROOT_ID"
>
</key>
<one-to-many
class="gov.usps.sakcarrier.db.vo.PSF2734DetailRecord"
/>
</set>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-PSF2734RootRecord.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
l = (Long) s.save(r);
s.flush();
Full stack trace of any exception that occurs:Name and version of the database you are using:Oracle 9i 9.0.2.4
Debug level Hibernate log excerpt:Code:
[2004-09-02 11:51:50,248] DEBUG (net.sf.hibernate.type.LongType nullSafeSet.46) - binding '336' to parameter: 8
[2004-09-02 11:51:50,248] DEBUG (net.sf.hibernate.impl.BatcherImpl addToBatch.28) - Adding to batch
[2004-09-02 11:51:50,248] DEBUG (net.sf.hibernate.impl.BatcherImpl doExecuteBatch.50) - Executing batch size: 1
[2004-09-02 11:51:50,388] DEBUG (net.sf.hibernate.impl.BatcherImpl doExecuteBatch.58) - success of batch update unknown: 0
[2004-09-02 11:51:50,388] DEBUG (net.sf.hibernate.impl.BatcherImpl logClosePreparedStatement.207) - done closing: 0 open PreparedStatements, 0 open ResultSets
[2004-09-02 11:51:50,388] DEBUG (net.sf.hibernate.impl.BatcherImpl closePreparedStatement.269) - closing statement
[2004-09-02 11:51:50,451] DEBUG (net.sf.hibernate.impl.SessionImpl postFlush.2824) - post flush
The problem in short is, when I flush the session, my thread of execution terminates without any exceptions. If I don't flush the session, the execution proceeds as normal.