[infinispan-dev] AtomicMap and mutable objects

Manik Surtani manik at jboss.org
Fri Dec 3 05:33:46 EST 2010


On 3 Dec 2010, at 10:13, Manik Surtani wrote:

> Hi Emmanuel.
> 
> With RepeatableRead, tx2 won't see the update till tx1 commits because the update (map.put()) is held in a change list until the tx is committed, before it is applied to the underlying AtomicMap.  (Remember, what you get is a proxy).
> 
> Ah, I see your question though; assuming the reference to the date is the same.  Hmm, in this case you may well see the change before tx1 commits, we don't explicitly clone or copy mutable objects.  We assume objects in an atomic map are immutable.  I suppose though we could add the ability to defensively copy mutable objects, but we'd need a way of knowing which are immutable, etc.  Also, this would be more expensive, depending on the size of the atomic map.
> 
> Cheers
> Manik
> 
> PS: This is probably a discussion for infinispan-dev.

Whoops, this is on infinispan-dev.  :-)  Why did I think it was on some other mail list?

--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org







More information about the infinispan-dev mailing list