I have a Ignite Cache like this: IgniteCache cache;
The cache is configured with:
<property name="readThrough" value="true" />
<property name="writeThrough" value="true" />
<property name="writeBehindEnabled" value="true" />
And a CacheStore for a MariaDB 3rd party persistence.
<property name="cacheStoreFactory">
<bean class="javax.cache.configuration.FactoryBuilder"
factory-method="factoryOf">
<constructor-arg>
<bean class="my_backend_bean">
<constructor-arg value="jdbc:mariadb://xxxxx" />
<constructor-arg value="user" />
<constructor-arg value="password" />
</bean>
</constructor-arg>
</bean>
</property>
This seems to be working well in general. I see storing objects with cache.put(key,object) returning quickly, while the MariaDB is updated asynchronously.
However, I'm experiencing the some issues where the MariaDB is not always updated with the latest values of the objects. I'm trying to find the reason for this.
So here are my questions: - if I do cache.put("1", object) once, then change a property in the object, then do cache.put("1", object) again, will Ignite call the write method of the cache store backend bean again for updating the MariaDB? I see this is happening on my tests but wonder when might Ignite not update the cache store? What shows Ignite that the object was modified for the same key? Are there circumstances when Ignite hasn't written the first object to the store yet and the second cache.put is called, will this cause the issue not updating the cache store? - should I better check cache.containsKey and then call cache.replace instead of cache.put? Or will replace actually call the delete function of my cache store backend bean?
Thanks!