Hello, increment/decrement is a read-modify-write operation, so to achieve the desired behavior you need to lock the key and perform the operation under that lock. So you need to use a transaction mode and isolation level that meet the requirements.
For this case, you could use the approach described here. https://apacheignite.readme.io/docs/jcache#section-entryprocessor. As well PESSIMISTIC REPEATABLE_READ/SERIALIZABLE should work too https://apacheignite.readme.io/docs/transactions#section-pessimistic-transactions. If you anticipate that increment/decrement operation contention won't be very high, then you could try OPTIMISTIC SERIALIZABLE and handle TransactionOptimisticException as described here https://apacheignite.readme.io/docs/transactions#section-optimistic-transactions Kind regards, Alex -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
