[infinispan-dev] Questions on AtomicMap and improvement proposals

Manik Surtani manik at jboss.org
Wed May 18 07:24:34 EDT 2011


On 18 May 2011, at 12:17, Emmanuel Bernard wrote:

> 
> On 18 mai 2011, at 12:23, Manik Surtani wrote:
> 
>> 
>> On 30 Apr 2011, at 20:14, Emmanuel Bernard wrote:
>> 
>>> Another behavior I'm seeing that is surprising me is:
>>> 
>>> tx.begin();
>>> Map<?,?> map = AtomicMapLookup.getAtomicMap(cache, key);
>>> assert map.size() == 3;
>>> AtomicMapLookup.removeAtomicMap(cache, key);
>>> assert map.size() == 0;
>>> tx.commit();
>>> 
>>> I can sort understand in a twisted way that removeAtomicMap clears the underlying map but that's for sure surprising and can lead to weird bugs for ATM users. Is that necessary?
>> 
>> This is weird, from a usage perspective, agreed.
>> 
>> Realistically, any operations that happen on an atomic map handle after the atomic map has been removed should result in an exception.  I can't think of any existing JDK exceptions being valid - perhaps InvalidAtomicMapException?
>> 
>> @Emmanuel, WDYT?
> 
> IllegalStateException works, I'd say

Ok, ISE it is then.

https://issues.jboss.org/browse/ISPN-1121


--
Manik Surtani
manik at jboss.org
twitter.com/maniksurtani

Lead, Infinispan
http://www.infinispan.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20110518/67f52f54/attachment.html 


More information about the infinispan-dev mailing list