-->
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: L2 cache hit/miss notification
PostPosted: Thu Jul 31, 2008 4:28 pm 
Newbie

Joined: Thu Jul 31, 2008 4:09 pm
Posts: 2
Hi,

I'm caching native sql queries with L2 cache. Everything works fine. I'm getting cache hits, etc. There's a flaw though (probably I missed something). Everytime before I execute query I need to call db procedure which is time consuming and I'd like to avoid if possible.
The scenario is as follows: if I get cache miss I need to call db procedure and then let hibernate proceed with actual query against db; but if I get cache hit I don't want db procedure being executed. Is there a way to register some listener which would be notified when cache hit/miss took place?

I'm using hibernate 3.2.4, ehchache 1.5.0.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 01, 2008 11:50 am 
Newbie

Joined: Thu Jul 31, 2008 4:09 pm
Posts: 2
Solved :)

I created decorated cache with methods for adding and removing listeners. Then I replaced original cache with decorated one in CacheManager. Listeners' notification methods are triggered upon cache miss/hit in decorated cache.

Solution found (as usual) in TFM ;)


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.