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: selective caching question
PostPosted: Mon Jan 31, 2005 5:35 pm 
Newbie

Joined: Mon Jan 31, 2005 5:27 pm
Posts: 2
We would like to use the JBossCache for replicating data across machines, however we don't want all the data to be replicated. It would be really nice if we could set a "isCacheable" boolean on objects we would like to be cached.

I think the only way to prevent data from replicated is to prevent hibernate from adding the objects into its second level cache. However objects are immediately added into the second level cache when doSave() is called in the Session. At the moment, we have all classes & collections cached and feel there is too much unnecessary data being distributed on the network. Is there something else that can be tried to have a selective-object caching?

Dean Mao
InterContinental Hotels Group


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 31, 2005 5:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Does the new CacheMode in HB3.0 help? (It should do...)

Otherwise, in HB3, you could enable hibernate.cache.use_structured_cache_entries, and write a Cache implementation that wraps JBossCache and intercepts put(), inspects the property value Map.

If that is too messy, or can't work, I'm receptive to adding some callback.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 31, 2005 5:59 pm 
Newbie

Joined: Mon Jan 31, 2005 5:27 pm
Posts: 2
I had a brief spasm of insight while looking through the hibernate code. Would it be possible to extend the TreeCacheProvider and TreeCache classes, and then override the TreeCache.put() and TreeCache.get() to selectively decide what objects go into the cache? This would be a bit hackish, but would it work?

I assume this is what you mean by "writing a Cache implementation that wraps JBossCache and intercepts put()" ?

Dean
InterContinental Hotels Group


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.