[infinispan-dev] Doubts about TxDistributionInterceptor and possible break in transaction isolation
Pedro Ruivo
pedro at infinispan.org
Mon Jun 17 06:52:45 EDT 2013
Hi guys,
I've been looking at TxDistributionInterceptor and I have a couple of
questions (assuming REPEATABLE_READ isolation level):
#1. why are we doing a remote get each time we write on a key? (huge
perform impact if the key was previously read)
#2. why are we doing a dataContainer.get() if the remote get returns a
null value? Shouldn't the interactions with data container be performed
only in the (Versioned)EntryWrappingInterceptor?
#3. (I didn't verify this) why are we acquire the lock is the remote get
is performed for a write? This looks correct for pessimistic locking but
not for optimistic...
After this analysis, it is possible to break the isolation between
transaction if I do a get on the key that does not exist:
tm.begin()
cache.get(k) //returns null
//in the meanwhile a transaction writes on k and commits
cache.get(k) //return the new value. IMO, this is not valid for
REPEATABLE_READ isolation level!
wdyt?
Thanks.
Cheers,
Pedro Ruivo
More information about the infinispan-dev
mailing list