[infinispan-dev] on optimistic locking semnatics

Mircea Markus mmarkus at redhat.com
Fri Jun 22 10:47:14 EDT 2012


Hi guys,

I've come around a JIRA[1] about optimistic locking and write skew check, and wondering what's the expected behavior in the following scenario:
tx1.begin()
read(a); 
 // tx2 modifies 'a' and commits changes
write(b);
tx1.commit() - shall I get a write skew (version changed) exception here as a was modified between read and commit?
   
In other words, shall I also perform write skew check for the entries that were read during a tx? We currently don't, but I can totally see situations in which this would be needed: if the decision to write to 'b' is made on the value of 'a' and there's an invariant containing both a and b.


[1]https://issues.jboss.org/browse/ISPN-1841

Cheers
Mircea
--
Mircea Markus
twitter.com/mirceamarkus

Sr. Software Engineer, Infinispan
http://www.infinispan.org


More information about the infinispan-dev mailing list