-->
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: Performance problem with one-to-many Association
PostPosted: Wed Nov 10, 2004 4:46 am 
Newbie

Joined: Thu Oct 14, 2004 7:38 am
Posts: 5
Hi,

I have some serious performance problems by lazy initializing the child records in an one-to-many Association.
When performing Hibernate.initialize(catiaVariable.getRwpXVersRelevants()) there is a lot more of SQL traffic I expected...
First there is a select on "RWP_X_VERS_RELEVANT" by column "IDVAR" (which I expected). There are n rows returned.
But then there is for every row a new select on "RWP_X_VERS_RELEVANT" by column "IDVAR" and "IDRELV" - I suppose to load the "RwpXVersRelevant". Is there a way to prevent these n select's ?

Hibernate version:
2.1.6
Mapping documents:
<class name="CatiaVariable" table="RWP_CATIAVD_VARIABLE">
<id name="id" type="integer" column="ID" >
<generator class="assigned"></generator>
</id>
<property name="name" column="VAR_NAME" type="string"/>
...
<set name="RwpXVersRelevants" table="RWP_X_VERS_RELEVANT" lazy="true" inverse="true">
<key column="IDVAR" />
<one-to-many class="RwpXVersRelevant"/>
</set>
</class>

<class name="RwpXVersRelevant" table="RWP_X_VERS_RELEVANT">
<composite-id>
<key-many-to-one name="catiaVariable" class="CatiaVariable" column="IDVAR" />
<key-many-to-one name="versRel" class="VersRel" column="IDRELV" />
</composite-id>
<property name="isDeleted" column="ISDELETED" type="boolean"/>
<property name="isRelevant" column="ISRELEVANT" type="boolean"/>
<property name="text" column="TEXT" type="string"/>

</class>


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.