[infinispan-dev] Atomic operations and transactions

Manik Surtani manik at jboss.org
Mon Jul 11 08:26:34 EDT 2011


On 11 Jul 2011, at 13:21, Mircea Markus wrote:

> 
> On 11 Jul 2011, at 10:45, Manik Surtani wrote:
> 
>> 
>> On 4 Jul 2011, at 07:57, Galder Zamarreño wrote:
>> 
>>> I get the feeling that those atomic operations are particularly useful when transactions are not used cos they allow you to reduce to cache operations to one, hence avoiding the need to use a lock or synchronized block, or in our case, a transaction.
>> 
>> Precisely.  I think the atomic ops should be documented such that they are not used within a transaction scope, possibly either:
>> 
>> 1) suspending any ongoing tx if used, or 
>> 2) throwing an illegal state exception if used within a tx scope
> +1 for the 2nd approach. At least up to the moment one comes with a use case for using them within a tx.

Yes, it is just more explicit that way.

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

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






More information about the infinispan-dev mailing list