[jboss-user] [JBoss Cache Users] - MVCC and writeSkewCheck

anothermarcus do-not-reply at jboss.com
Fri Nov 27 12:49:52 EST 2009


HI everyone,

I'm using Jboss Tree Cache pojo version NAGA 3.0
How can I invoke an exception to see the behaviour of the writeSkewCheck?

I've seen several articles explaining the Phantom Read at a very high level, but down to an API user's level, how can I simulate a skewed write.


Say for example two threads within the same JVM do 


  | Cache internalCache = getCache();
  | 
  | Node rootNode = internalCache.getRoot();
  | Node sequenceNode = rootNode.getChild(Fqn.fromString(SEQUENCE_FQN));
  | 
  | // READ
  | Integer sequence = (Integer) sequenceNode.get(SEQUENCE_FQN);
  |                         
  | Thread.sleep(1000);
  | // WRITE
  | sequenceNode.put(SEQUENCE_FQN, sequence +1);
  | 

Will having two threads like this invoke a skewed write that will throw an exception to the user?  If so, I'm not seeing it happen.



Thanks for any advice 




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

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



More information about the jboss-user mailing list