-->
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: Current session cache making query lookups slower
PostPosted: Mon Jun 26, 2006 11:01 am 
Newbie

Joined: Mon Jun 26, 2006 10:39 am
Posts: 5
Hi,

I used Hibernate for my object model to persist. I needed to import raw data from legacy database to my object model database. I had to deal with a huge number of rows (1 - 15 million rows)

In this process, to import an object, I had to check for the existence of the object and do either insert/update (save or update).

The lookups are by a property name (account name). So I created look up methods.

I have the second-level cache and query cache also enabled. My lookups were slower when I had single session (provides first level cache) for many transactions (includes lookup and save), whereas it was quite faster when I had a new session for each transaction.

Most of the time, my lookups may not find the right candidate in cache because it is an import service to import new data.

So does having a single session with lot of objects in the cache (for example 10,000) and not finding a match causes overhead?

Can anyone help me figure out the reason for slow performance to do the lookups?

Thanks in advance.

_________________
Thanks,
Amala


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 5:30 pm 
Newbie

Joined: Fri Jun 23, 2006 1:46 pm
Posts: 5
Are you using ehcache?
If so, do you have overflowToDisk set to true?
If you have lots of records in your cache it’s quite possibly overflowing them to disk, which as I understand it just does a standard java object serialization to the file system. Deserializing them off the file system would probably be slower than just reading them in form the DB.
That’s the only thing I can think of off the top of my head.


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.