-->
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: Large set
PostPosted: Tue Oct 18, 2005 5:44 am 
Newbie

Joined: Fri May 27, 2005 6:16 am
Posts: 14
Hi,

I have a program where I load a folder with around 200 files of each 3MB. The files contain units which I load as a parent-child set and attach them to the File object. There might be tens of thousands of Unts per File. In large sets this amounts to around 1GB which I load into memory.

In File.hbm:
<set name="Unit" lazy="false" inverse="true" cascade="all">
<key column="FILE_ID"/>
<one-to-many class="Unit"/>
</set>

Now, when I start the loading procedure, the first 100 or so Files get loaded within seconds, but after that it gest painfully slow. The last files take minutes to load, although they are the same size as the first ones. I tried mapping the units as a bag, but then I get ConcurrentModificationExceptions when loading.

Is there any way to speed up the usage of Collections for large sets, what is the best collection type for large sets? Or can I tell hibernate to use a sort of on-disk cache so that not all data is saved in memory?

Regards,
Leen Toelen


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 7:35 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
You may evict some instance from session cache
if you do not need them, like
Code:
session.evict(myObject);


Of course you are losing the benefits of the cache then.
For e.g. batch processing of large data sets the StatelessSession
might be a good solution.


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.