lock and unlock the cache key?
how it can be performed as i want to lock a particular key and then unlock it.Suggest me the way how can i check whether key is locked or not? cache.lock(key)- it locks the key but how to unlock the key?? -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/lock-and-unlock-the-cache-key-tp2950.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: lock and unlock the cache key?
tHANKS to all -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/lock-and-unlock-the-cache-key-tp2950p2958.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: lock and unlock the cache key?
Lock.unlock(long) here long is needed but i want unlock object as key?? as i locked using IgniteCache.lock(key).? -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/lock-and-unlock-the-cache-key-tp2950p2954.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: lock and unlock the cache key?
Ravi, Please clarify what long do you mean? Here is short code snippet showing lock/unlock cycle: IgniteCache cache = ...; Lock lock = cache.lock(key); lock.unlock(); Vladimir. On Thu, Feb 11, 2016 at 1:12 PM, Ravi <ravikumarpur...@gmail.com> wrote: > Lock.unlock(long) here long is needed but i want unlock object as key?? > as i locked using IgniteCache.lock(key).? > > > > > > -- > View this message in context: > http://apache-ignite-users.70518.x6.nabble.com/lock-and-unlock-the-cache-key-tp2950p2954.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. >
Re: lock and unlock the cache key?
Ravi, A small typo sneaked to the code snippet - the lock() call was omitted - it should be like this (I also omitting the try-finally block for the simplicity) IgniteCache cache = ...; Lock lock = cache.lock(key); lock.lock(); // ... process while lock is held lock.unlock();