You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Ramzinator <ra...@gmail.com> on 2017/05/23 14:39:34 UTC

IgniteCache.containsKey does not acquire Transaction lock

Hi all,

I've recently upgraded to Ignite 2.0 and noticed that
IgniteCache.containsKey no longer acquiring a transaction lock on the passed
key. In my experience, it seemed to be the case in ignite 1.8 & 1.9.
(Correct me if I'm wrong, I assume a containsKey is considered as a READ
cache operation)

To showcase the issue, please consider the following test:

IgniteContainsTransactionTest.java
<http://apache-ignite-users.70518.x6.nabble.com/file/n13090/IgniteContainsTransactionTest.java>  

Thanks,
Rami






--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/IgniteCache-containsKey-does-not-acquire-Transaction-lock-tp13090.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: IgniteCache.containsKey does not acquire Transaction lock

Posted by vdpyatkov <vl...@gmail.com>.
Hi,

cache.containsKey() never locking key (I checked it in Ignite version 1.7
till 2.0), but you can use simple cache.get().
This method (cache.get) will got a lock for particular key, even if returns
null.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/IgniteCache-containsKey-does-not-acquire-Transaction-lock-tp13090p13165.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.