Jimmy,

The approach you suggested will not work either. Consider a situation when
concurrent updates are required for your object. In this case there is a
chance that you modify version 1 of your object, but when you do a
cache.get(), you will receive already updated, different version of your
object and the computations you've made based on version 1 become invalid.

>From what you've described it looks like you need to integrate cache
transaction with your application-level transaction and use PESSIMISTIC
REPEATABLE_READ or OPTIMISTIC SERIALIZABLE transaction isolation. In this
case each time you do a cache.get(), you will receive a transaction-local
copy of your object, which you will later be able to put to the cache. Take
a look at JTA integration documentation [1]. However, I want to emphasize
that even if this approach of modifying objects in-place works, it is still
not a recommended way to use Ignite and we cannot guarantee that it will
work in the future versions of Ignite.

Hope this helps,
AG

Reply via email to