-->
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.  [ 3 posts ] 
Author Message
 Post subject: hibernate second level cache "Memory cache hit, but ele
PostPosted: Sun Nov 09, 2008 2:18 am 
Newbie

Joined: Wed Oct 08, 2008 3:06 pm
Posts: 13
Location: Seattle
What does "Memory cache hit, but element expired"? I tried to do searches on this forum, but returned nothing that is helpful..

What I did is basically run the same query several times. I expected that after first time, the data should be cached so that I could get a "hit" when I run it 2nd time.. But It gave me "Memory cache hit, but element expired"?

Where did I do wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 09, 2008 6:48 am 
Expert
Expert

Joined: Fri Jul 13, 2007 8:18 am
Posts: 370
Location: london
I'm assuming you're using ehcache here. When an element is cached it has an associated life span, determined by the ehcache configuration for the class. In your case, the life span of the cached element is shorter than the time between the query runs. The element is found in the cache but deemed too old to be used so a fresh query to the database is run.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 09, 2008 9:08 pm 
Newbie

Joined: Wed Oct 08, 2008 3:06 pm
Posts: 13
Location: Seattle
thatmikewilliams wrote:
I'm assuming you're using ehcache here. When an element is cached it has an associated life span, determined by the ehcache configuration for the class. In your case, the life span of the cached element is shorter than the time between the query runs. The element is found in the cache but deemed too old to be used so a fresh query to the database is run.


Thank you for your reply..

I did use ehcache for second level caching. The point is the time between I run 2 queries is like 2 secs. I don't think it would expire in 2 secs. And it worked on my laptop (I got a hit after the second run) but not on another machine (test environment) with the same configuration after I deployed it. I gave me "Memory cache hit, but element expired".


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