-->
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: batch-size and one-to-many associations
PostPosted: Sat Jul 09, 2005 10:20 pm 
Senior
Senior

Joined: Tue Jun 21, 2005 10:18 am
Posts: 135
Location: South Carolina, USA
Are there any guidelines for setting batch-size on a lazy loaded collection, particularly in the case of a one-to-many association?

Take a Person object with a one-to-many assocation to Address objects.

If the Address end of the association was particularly hard or expensive to load, I can understand setting batch-size to a relatively small number. But in this case (and likely most cases), I am selecting, say, less than ten fields (non-LOB) to get each Address object. Why would I even want to set a batch-size? My immediate thought is batch-size="1000" -- or better, batch-size="all of 'em" (obviously not a valid syntax ;) ).

So, I feel like I must be missing something here. If hibernate is only going to batch-load the uninitialized Address objects in the session, and that only requires a single statement, why wouldn't I want rows for all the uninitialized Address objects in the session by default?

Sorry if it's a stupid question, but I did try to search for an answer to it.


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.