-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to index all entities without suffering from OutOfMemory
PostPosted: Thu May 13, 2010 2:32 pm 
Regular
Regular

Joined: Mon Mar 10, 2008 6:40 pm
Posts: 114
I've read page 154 of Hibernate Search in Action where Listing 5.22 gives an example of going through all Item entities and indexing them one by one. I did this and it worked... when my tables were small. Unfortunately as I've outlined in this stackoverflow question about ScrollableResults, it seems that MySQL loads all rows for a ScrollableResult set into RAM before proceeding... so OutOfMemoryErrors are inevitable:
http://stackoverflow.com/questions/2826319/using-hibernates-scrollableresults-to-slowly-read-90-million-records

What's the best approach for this?


Top
 Profile  
 
 Post subject: Re: How to index all entities without suffering from OutOfMemory
PostPosted: Thu May 13, 2010 5:36 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
The problem with the ScrollableResults is really a db problem in this case. Using pagination is a potential solution, but it seems that has not worked for you either.

I recommend you try the mass indexer api which got introduced with the latest release of Search (3.2.0.Final). Check the online documentation for this new API and some usage examples.

--Hardy


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