Dear Manik,

We have stepped through the JBossCache code and these are our findings-

1. Optimistic locking does bring a layer of transaction workspace in between. 
However, the TransactionWorkspace takes care that the entries are added in the 
tree data structure starting from the root of the cache. Thus TreeCache_put() 
methods are actually bypassed during optimistic locking. 
2. Even when the transaction is committed, the _put() methods are not called 
since the tree data structure already contains the node.
Note that in the JBossCache code, notifyNodeModify() and notifyNodeModified() 
methods are *ONLY* called from the _put() methods of TreeCache and nowhere 
else. Thus with Optimistic locking, modify notifications are *never* made to 
the tree cache listeners. The listeners receive notification for node creation 
but that is not useful because data corresponding to the FQN would be null

3. It is also observed that if i put data in cache1 which is replicated to 
cache2, the listener for cache2 is notified about node creation. However, when 
i try to get the data from cache2, I get null. Can you explain this?



Unless this was intentional, we feel that this may be a bug in the JBoss cache 
code.

Unless you have a workaround for this, I guess we will have to use Pessimistic 
locking with our own versioning for the data.


Thanks and Regards,
Varun

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3951029#3951029

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3951029


_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to