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: Efficient Loading of Large Object Graph
PostPosted: Wed Jan 04, 2006 1:45 pm 
Newbie

Joined: Wed Jan 04, 2006 1:09 pm
Posts: 1
Hibernate version: 2.1.6

Name and version of the database you are using: Microsoft SQL Server 2000


I have the following object graph:

Class A contains a one-to-many relationship with class B (with a size ranging from 5 to 5000 objects)
Class B contains a one-to-many relationship with class C (with a size of around 7 objects)
Class C contains a one-to-many relationship with class D (some of size 0 object and some of size 5 objects)

When I load Class A’s collection of B objects, I need to load the full object graph (Class B’s collection of C objects, and Class C’s collection of D objects). I am currently setting a large batch-size value on these collections to decrease the number of queries that need to be run to load the object graph. However, for my large A objects (when A has 5000 B objects), there are still to many queries being run to load all of my D objects.

I’d like to set it up so that C’s collection of D objects are loaded through an outer join when the collection of C objects is loaded. Then, the following queries would be executed:

1. Load all B objects that are a member of A
2. For each batch of B objects in A, load all C & D objects that are in a B in this batch

Is there anyway to configure this? Also, is there anyway to dynamically select batch-size? I know this will eliminate the benefit of prepared statements, but the benefit may outweigh that cost for me.

Or, are there any other alternatives that may help me?

Thanks in advance for any help.


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.