-->
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: Problem with many-to-many associations and lazy
PostPosted: Wed May 02, 2007 3:39 pm 
Newbie

Joined: Wed May 02, 2007 3:13 pm
Posts: 2
Hibernate version: 3.05 (bound to jdk 1.3)

Mapping documents:

<class name="com.bnc.gcc.model.bo.User" table="APPUSER">
....
<set name="userAccountManagers" table="UserAccMgr" inverse="true" lazy="false" where="ENDINGDATE IS NULL OR ENDINGDATE &gt;= GCC.OCTPREC (SYSDATE) + 1">
<key column="User_Id" update="false"/>
<one-to-many class="com.bnc.gcc.model.bo.UserAccMgr"/>
</set>
</class>

<class name="com.bnc.gcc.model.bo.UserAccMgr" table="USERACCMGR">
...
<many-to-one name="userRelated" class="com.bnc.gcc.model.bo.UserRelatedToUserAccMgr" lazy="true" insert="false" update="false">
<column name="USER_ID" />
</many-to-one>
</class>

<class name="com.bnc.gcc.model.bo.AccMgr" table="ACCMGR">
...
<set name="userAccountManagers" table="UserAccMgr" inverse="true" lazy="true" where="ENDINGDATE IS NULL OR ENDINGDATE &gt;= GCC.OCTPREC (SYSDATE) + 1">
<key column="ACCMGR_ID" not-null="false" update="false"/>
<one-to-many class="com.bnc.gcc.model.bo.UserAccMgr"/>
</set>
</class>

<class name="com.bnc.gcc.model.bo.UserRelatedToUserAccMgr" table="APPUSER">
...
</class>


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

Full stack trace of any exception that occurs:
No errors

Name and version of the database you are using:
Oracle 9i

Everytime i load the set of USERACCMGR from any side of the relation
hibernate load every UserRelatedToUserAccMgr even if it's lazy true.
I dont have any errors but from performance side its like 2000 extra SQL call.

Any solution ?

Thank you


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.