-->
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: second level cache no hits
PostPosted: Tue Aug 08, 2006 9:13 am 
Newbie

Joined: Tue Aug 08, 2006 8:54 am
Posts: 2
Hi everybody!

I'm new to hibernate and ehcache! I want to implement a hibernate second level cache. So I try ehcache.

I have created a simple table with 500 entries for test purposes. I also created the ehcache.xml conf file. For performance tests I implement a junit test case. This test case requested the result list (500 entries) five times. I run the application with and without ehcache for 2nd Level cache. But I get no optimization. The timer always shows the same time span.

Therefore I printed out the log file to be sure my second level cache was enabled. So I got the messages that every entry get cached. But also a sql query was executed and printed at the console. In my view the data comes from DB and not from ehcache. This is the reason why I don't get an optimization.

How can I get data from ehcache without execute a query?

Can anyone help me?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 10:15 am 
Newbie

Joined: Tue Aug 08, 2006 8:54 am
Posts: 2
in addition:

This is my log:

16:01:57,518 DEBUG TwoPhaseLoad:107 - resolving associations for [Preview#1]
16:01:57,518 DEBUG TwoPhaseLoad:135 - adding entity to second-level cache: [Preview#1]
16:01:57,518 DEBUG ReadOnlyCache:55 - item already cached: Preview#1
16:01:57,518 DEBUG TwoPhaseLoad:206 - done materializing entity [Preview#1]
16:01:57,518 DEBUG TwoPhaseLoad:107 - resolving associations for [Preview#2]
16:01:57,518 DEBUG TwoPhaseLoad:135 - adding entity to second-level cache: [Preview#2]
16:01:57,518 DEBUG ReadOnlyCache:55 - item already cached: Preview#2
16:01:57,518 DEBUG TwoPhaseLoad:206 - done materializing entity [Preview#2] ............


the cached previews are already in the cache, but how can I avoid to execute sql query for another load. In my point of view the data should be retrieve from cache.

Please help me!


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.