-->
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.  [ 1 post ] 
Author Message
 Post subject: Why does NonstrictReadWriteCache.release call remove?
PostPosted: Thu May 18, 2006 1:56 pm 
Newbie

Joined: Thu May 18, 2006 8:09 am
Posts: 1
We are using a custom clustered second-level cache similar to SwarmCache in the sense that removes performed on the local cache are distributed to all other caches in the cluster (clustered invalidation). My understanding of the documentation is that NonstrictReadWriteCache is the correct CacheConcurrencyStrategy to use with this type of cache. However, we observed that loading an object with LockMode.READ set (to intentionally bypass the cache) was resulting in the generation of invalidation messages in the cluster. A look at the Hibernate code revealed that DefaultLoadEventListener.lockAndLoad calls lock/release on the CacheConcurrencyStrategy, and NonstrictReadWriteCache.release calls remove on the underlying cache, generating the invalidation. The call from DefaultLoadEventListener.lockAndLoad to NonstrictReadWriteCache.release appears to be contrary to the javadoc for CacheConcurrencyStrategy.release which states that it is "Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion."

My questions are:
- Is it correct that lockAndLoad is calling release? If it is (as I suspect) correct, perhaps the Javadoc for CacheConcurrencyStrategy needs updating?
- More importantly, why is it necessary that NonstrictReadWriteCache.release calls remove on the underlying cache? As far as I can tell, lock/release on a nonstrict cache should be a no-op. Even the Javadoc for NonstrictReadWriteCache.release says the purpose is to "Invalidate the item (again, for safety)." Is there some problem that might be caused by not calling remove, i.e. is it intentional that loads with LockMode.READ should generate invalidations in the cluster?

We are using Hibernate version 3.1.2.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.