ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkulichenko <valentin.kuliche...@gmail.com>
Subject Re: CacheStore implementation using Hibernate
Date Tue, 22 Sep 2015 03:59:42 GMT
kevin wrote
> Wouldn't IgniteCache.putIfAbsent() only work when you're inserting a new
> value (two concurrent creates, as opposed to two concurrent updates)?

putIfAbsent() operation means that the entry will not be updated if the
value is already set, i.e. will not be overwritten. In case of put()
operation the value will be always updated, but you don't need to bother
about locking, Ignite will do this for you. What behavior do you expect in
case of concurrent updates?

kevin wrote
> I noticed that the CacheInterceptor was being called twice for one update.
> (Is it once for the primary copy and once for the backup copy?) It seems
> that depending which node does it first, entry.getValue() on the second
> node could either contain the values before OR after the changes made by
> CacheInterceptor.

Yes, the interceptor will be called on both primary and backup nodes. But
what you say sounds a bit weird because interceptor should be always called
with the same value (not modified). Is it possible for you to provide a test
that reproduces this behavior?

kevin wrote
> Also if the cache entry is not loaded, does read-through occur during the
> CacheInterceptor stage?

If read-through is configured, the old value will be loaded from the store
before calling the interceptor.


View this message in context: http://apache-ignite-users.70518.x6.nabble.com/CacheStore-implementation-using-Hibernate-tp1423p1457.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message