-->
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.  [ 4 posts ] 
Author Message
 Post subject: Large Tables! Much Data! Performance loss/memory problems?
PostPosted: Fri Nov 04, 2005 5:45 pm 
Newbie

Joined: Fri Nov 04, 2005 5:40 pm
Posts: 16
Hello,

I am using Hibernate, so i have a Table users and a one-to-many that points to a Inbox Table.

The Problems is that it may happen that a User has 10000 messages in his Inbox.

How does Hibernate work. Does it load all the 10000 Messages into the User.messages List?

Wouldnt it be a memory problem when i have 20 Users with 10000 Messages each.

When i want to get the first 10 messages of a user, would it be better to go over "session.createQuery" with a LIMIT statement than over user.getMessages.iterator() ???


I hope you can help me understandin how Hibernate works, and help me with my lil problem. :P

Thank you
daniel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 6:01 pm 
Newbie

Joined: Wed Sep 28, 2005 12:24 am
Posts: 15
check out lazy loading :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 6:14 pm 
Newbie

Joined: Fri Nov 04, 2005 5:40 pm
Posts: 16
okay i will read a bit about lazy loading, but what do you say to my little problem.

would you go over a SQL statement with LIMIT
or would you go over parent.childList and use an iterator to get the first 10.


thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 8:19 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Daniel,
use ScrollableResults


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.