-->
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.  [ 4 posts ] 
Author Message
 Post subject: Invalidating the second level cache (and other caches?)
PostPosted: Tue Jan 08, 2008 6:39 am 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
Hello,

We are going to use Hibernate on top of an existing REPLICATED database.

This means that there will be data beeing added, changed and removed behind Hibernates back at least every night, sometimes also during ad hoc replication.

This all works out nice, but I think we will have issues related to caching.

When replicating this way, do we need to refresh any caches? If so, is there a way to do so programmatically for all caches?

Not sure if we should have a thread that does this periodically and programmatically... or are there better ways?

The solution must work on all kinds of database products (which is why we use Hibernate to begin with :)

Ideas are appreciated!


Top
 Profile  
 
 Post subject: Re: Invalidating the second level cache (and other caches?)
PostPosted: Tue Jan 08, 2008 10:15 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
In most caches you can specify a time to live for each region. Won't that do enough for you?



Farzad=


Top
 Profile  
 
 Post subject: No
PostPosted: Wed Jan 09, 2008 4:16 am 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
No, because the replication can occur anytime when running it ad-hoc (i.e. after some server has been down)

So I think I really need some way to force an update of the caches.


Top
 Profile  
 
 Post subject: Re: No
PostPosted: Wed Jan 09, 2008 10:27 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
nickvajberg wrote:
No, because the replication can occur anytime when running it ad-hoc (i.e. after some server has been down)

So I think I really need some way to force an update of the caches.


this might not be the best solution but worst comes to worst you can access the underlying cache technology classes. For example, ehcache can export some mbeans. I am not aware what kind of things you can do through them but it is very likely you can manipulate cache regions. In any events, how do you programmatically realize it is time to evict a cache region? Isn't it better to set up a short life span cache region for sensitive data? This is not horrible, depending on uses cases, since db engines usually have a fairly strong cache.



Farzad-


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