Hibernate version: hibernate-2.1.4
Mapping documents: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="employeeclub.domain.Activity"
table="activity"
>
<id
name="id"
type="long"
column="id"
>
<generator class="net.sf.hibernate.id.TableHiLoGenerator">
<param name="table">activity_seq</param>
<param name="column">next_hi</param>
<param name="max_lo">1</param>
</generator>
</id>
<property
name="name"
type="java.lang.String"
column="name"
not-null="true"
length="255"
/>
<property
name="description"
type="java.lang.String"
column="description"
length="255"
/>
<!-- associations -->
<!-- bi-directional one-to-one association to ActivityTicket -->
<one-to-one
name="activityTicket"
class="employeeclub.domain.ActivityTicket"
property-ref="activity"
cascade="all"
outer-join="false"
/>
<!-- bi-directional many-to-one association to Category -->
<many-to-one
name="category"
class="employeeclub.domain.Category"
not-null="true"
>
<column name="category_id" />
</many-to-one>
</class>
</hibernate-mapping>
<?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>
<subclass name="employeeclub.domain.ActivityTicket" extends="employeeclub.domain.Ticket" discriminator-value="ACTIVITY_TICKET">
<!-- bi-directional many-to-one association to Activity -->
<many-to-one
name="activity"
class="employeeclub.domain.Activity"
column="detail_id"
cascade="all"
unique="true"
outer-join="false"
/>
</subclass>
</hibernate-mapping>
<?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>
<subclass name="employeeclub.domain.Ticket" extends="employeeclub.domain.Item"/>
</hibernate-mapping>
<?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="employeeclub.domain.Item"
table="item"
polymorphism="implicit"
discriminator-value="not null"
>
<id
name="id"
type="long"
column="id"
>
<generator class="net.sf.hibernate.id.TableHiLoGenerator">
<param name="table">item_seq</param>
<param name="column">next_hi</param>
<param name="max_lo">1</param>
</generator>
</id>
<discriminator
column="type_id"
type="java.lang.String"
/>
<property
name="name"
type="java.lang.String"
column="name"
not-null="true"
length="255"
/>
<property
name="listPrice"
type="employeeclub.dao.hibernate.type.MoneyType"
column="list_price"
not-null="true"
length="19"
/>
<property
name="unitCost"
type="employeeclub.dao.hibernate.type.MoneyType"
column="unit_cost"
not-null="true"
length="19"
/>
<property
name="description"
type="java.lang.String"
column="description"
not-null="true"
length="255"
/>
<property
name="quantity"
type="int"
column="quantity"
not-null="true"
length="4"
/>
</class>
</hibernate-mapping>
<?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="employeeclub.domain.Category"
table="category"
>
<id
name="id"
type="long"
column="id"
>
<generator class="net.sf.hibernate.id.TableHiLoGenerator">
<param name="table">category_seq</param>
<param name="column">next_hi</param>
<param name="max_lo">1</param>
</generator>
</id>
<property
name="name"
type="java.lang.String"
column="name"
not-null="true"
length="255"
/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close(): Using spring
Full stack trace of any exception that occurs: No exceptions
Name and version of the database you are using: MsSql 2000
The generated SQL (show_sql=true):Code:
Hibernate: select activity0_.id as id, activity0_.name as name, activity0_.description as descript3_, activity0_.category_id as category4_ from activity activity0_
Activity - setting activityTicket
Activity - setting activityTicket
Hibernate: select activityti0_.id as id0_, activityti0_.detail_id as detail_id0_, activityti0_.name as name0_, activityti0_.list_price as list_price0_, activityti0_.unit_cost as unit_cost0_, activityti0_.description as descript6_0_, activityti0_.quantity as quantity0_ from item activityti0_ where activityti0_.detail_id=?
ActivityTicket - setting activity
Hibernate: select category0_.id as id0_, category0_.name as name0_ from category category0_ where category0_.id=?
Activity - setting activityTicket
Activity - setting category
Hibernate: select activityti0_.id as id0_, activityti0_.detail_id as detail_id0_, activityti0_.name as name0_, activityti0_.list_price as list_price0_, activityti0_.unit_cost as unit_cost0_, activityti0_.description as descript6_0_, activityti0_.quantity as quantity0_ from item activityti0_ where activityti0_.detail_id=?
Debug level Hibernate log excerpt:All, I am able to save these objects successfully. I am even able to retieve a collection of "Activity" objects with out a problem. The problem occurs when I Iterate through the collection of objects. As soon as I try to access a property, my cpu shoots up to 100% and the process seems to hang. Any idea whats going on?
Regards,
Joshua[/code]