-->
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.  [ 7 posts ] 
Author Message
 Post subject: OutOfMemory
PostPosted: Fri Mar 26, 2004 5:49 am 
Beginner
Beginner

Joined: Tue Mar 23, 2004 4:18 pm
Posts: 45
Hi!

I select a fairly large amount of data from the database. More than fits into java heap space: OutOfMemory.

Is Hibernate smart enough to progressively fetch the data from database or will I have to do this myself but running multiple queries setting setMaxResults()/setFirstResult()?

What is the smartest way here?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 26, 2004 9:07 am 
Beginner
Beginner

Joined: Wed Mar 17, 2004 12:44 am
Posts: 25
does it mean that your result set is very big that it cannot fit into java heap ?

nitin


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 26, 2004 9:37 am 
Beginner
Beginner

Joined: Tue Mar 23, 2004 4:18 pm
Posts: 45
nitz_tech wrote:
does it mean that your result set is very big that it cannot fit into java heap ?

nitin


Yes (i.e. too many rows).


Top
 Profile  
 
 Post subject: Re: OutOfMemory
PostPosted: Fri Mar 26, 2004 3:31 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
tcn wrote:
Is Hibernate smart enough to progressively fetch the data from database or will I have to do this myself but running multiple queries setting setMaxResults()/setFirstResult()?

It's not an Hibernate issue,
Hibernate is expected to build a list containing the results, so it cannot deference them.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: OutOfMemory
PostPosted: Sat Mar 27, 2004 1:56 pm 
Beginner
Beginner

Joined: Tue Mar 23, 2004 4:18 pm
Posts: 45
emmanuel wrote:
tcn wrote:
Is Hibernate smart enough to progressively fetch the data from database or will I have to do this myself but running multiple queries setting setMaxResults()/setFirstResult()?

It's not an Hibernate issue,
Hibernate is expected to build a list containing the results, so it cannot deference them.


...but an JDBC driver issue?

So, you would propose a manual setFirstResult()/setMaxResulsts() solution (IMHO Hibernate could be somewhat more convinient about this :) ?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 28, 2004 7:41 am 
Beginner
Beginner

Joined: Tue Mar 16, 2004 5:15 am
Posts: 33
Isn't an iterator suitable or does Hibernate only iterates through an underlying result list? I thought an iterator is implemented like a cursor of the result set... .


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 28, 2004 8:08 am 
Beginner
Beginner

Joined: Tue Mar 23, 2004 4:18 pm
Posts: 45
Martin Kersten wrote:
Isn't an iterator suitable or does Hibernate only iterates through an underlying result list? I thought an iterator is implemented like a cursor of the result set... .


That's what I meant by "more comfortable". Something like:

setPageSize(10).iterate()

which does automatically setMaxResults(10) and repeat setFirstResult()..


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