-->
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.  [ 2 posts ] 
Author Message
 Post subject: Pulling *lots* of redundant data
PostPosted: Fri Feb 20, 2004 11:30 am 
Regular
Regular

Joined: Wed Sep 03, 2003 9:56 pm
Posts: 58
I have a one-to-many mapping (i.e. Parent/Child) from 'P' to 'C'. Each C object has a many-to-one to 'D', and the D object is really large (i.e. many columns). When Hibernate inflates P, the select statement for each of the associated C objects include *every* column for it's associated D object.

My problem is that there are relatively few (5 max) D objects, but many C objects that point to them. This results in pulling tons of duplicated D object data since there is ultimately an embedded D object within each returned C object (row).

Could this be a result of my session management stragegy since I allocate a session, inflate P, then close the session and return P?

Any suggestions would be greatly appreciated.

-Mitch


Top
 Profile  
 
 Post subject: Re: Pulling *lots* of redundant data
PostPosted: Fri Feb 20, 2004 12:06 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
mitchellch wrote:
Could this be a result of my session management stragegy since I allocate a session, inflate P, then close the session and return P?

Yes it is.
If you do not need D, then you can proxy it not to load it.
Or you can use the second-level cache
Or use the thread local session pattern to keep you session opened for a larger period of time.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.