-
Enhancement
-
Resolution: Unresolved
-
Minor
-
None
-
14.0.7.Final
We use Invalidation Mode a lot:
The documentation states corerctly:
Sometimes the application reads a value from the external store and wants to write it to the local cache, without removing it from the other nodes. To do this, it must call Cache.putForExternalRead(key, value) instead of Cache.put(key, value).
For us it is not sometimes but always as all data should be read from an external database.
If you do use put on node1 it sends a remove message to node2. node2 loads the data again puuting it into its cache and sending node1 a remove message. So the cache would just not be usable without putForExternalRead.
If you configure a cache with Invalidation mode you usually need to use putForExternalRead. So this should be an option for configuration.
In ehcache 2.x you can say "replicatePuts=false"
It would be nice to make it configurable. With a configuration Option you could even use putIfAbsent which is not possible right now
stackoverflow post: