-->
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.  [ 9 posts ] 
Author Message
 Post subject: out of memory error
PostPosted: Thu Nov 30, 2006 9:35 pm 
Newbie

Joined: Thu Nov 30, 2006 8:49 pm
Posts: 5
[b]Hibernate version: 3.1.3

[b]Full stack trace of any exception that occurs: java.lang.outofmemoryError

[b]Name and version of the database you are using: Oracle9i

can any one help me how to handle when we try to retrive more rows from database for example at about 50000....

I couldnt able to handle the situation. I am getting out of memory Error...

In Hibernate, is there any way to fetch the records partially not whole at a time.... for example loading records 20 at a time and again loading next 20...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 01, 2006 5:54 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
Did you use Query.setFirstResult() and Query.setMaxResults() ?

_________________
Best Regards


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 01, 2006 2:00 pm 
Senior
Senior

Joined: Wed Aug 17, 2005 12:56 pm
Posts: 136
Location: Erie, PA (USA)
Query has a scroll() method that returns a result iterator similar to using JDBC PreparedStatement/ResultSet.

StatelessSession may also be of interest to you.

Curtis ...

_________________
---- Don't forget to rate! ----


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 03, 2006 8:04 am 
Newbie

Joined: Thu Nov 30, 2006 8:49 pm
Posts: 5
i have used the method scroll()... but its of no use ... Still i am getting the same exception... By using setFirstResult() and setMaxResult() we have to condense the retreival of rows... Cant we get the full rows.. ie all 50000 rows


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 03, 2006 1:08 pm 
Newbie

Joined: Fri Dec 01, 2006 5:51 pm
Posts: 4
I think the configuration hibernate.jdbc.fetch_size could be what you need (Section 3.5 of http://www.hibernate.org/hib_docs/refer ... ation.html)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 03, 2006 6:29 pm 
Newbie

Joined: Sat Dec 02, 2006 10:55 pm
Posts: 10
WHy dont you try configuring the JVM heap itself (although i dont know much about data mining)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 03, 2006 10:00 pm 
Newbie

Joined: Fri Dec 01, 2006 4:28 am
Posts: 6
You need to increase the Java Heap Size.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 03, 2006 10:36 pm 
Newbie

Joined: Thu Nov 30, 2006 8:49 pm
Posts: 5
how to increase the JVM heap size.. can anyone give me a hint


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 04, 2006 12:01 am 
Newbie

Joined: Fri Dec 01, 2006 5:51 pm
Posts: 4
swetha wrote:
how to increase the JVM heap size.. can anyone give me a hint

I dont know how you start your JVM, however, you can pass the argument -Xms and -Xmx to your "java.exe" file to set Min/Max heap size (see: http://java.sun.com/j2se/1.4.2/docs/too ... /java.html)
Also, you can put these settings in the environment, for example
>set JAVA_OPTS=-mx256m (set max heap size = 256Mb)
>java bla bla...

Cheers,


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