If you only want one of the nodes to write to the backing store, simply enable the singleton store functionality, see https://docs.jboss.org/author/x/DwY5 for more info. I'm pretty sure this works fine with a replicated cache or a totally replicated cached, but with distribution, or partial replication, it might not work as expected because it relies on being the coordinator of the cluster in order to store the data (see https://docs.jboss.org/author/x/GwY5 to find out more about clustering modes). However, with distribution the coordinator might not all the data, so it might only work partially.
Very good, thanks. I'll try that out.
And what about collision detection (two transactions on separate nodes writing to the same cache data) - will collisions reveal themselves in the form of an exception? or is it not possible with MVCC?
I read the documentation you linked to , however it is not fully clear to me - what is the default behaviour of a cacheStore in distributed cache with backups? If node X writes value which is located in the primary partition of node A, and in the backup of B, by default showe CacheStore gets to write it to the database?
@Andrew, The reaction to those scenarions depends on whether you use optimistic or pessimistic locking. See https://docs.jboss.org/author/x/FAY5
@Georgi, I don't understand your question. With singleton store, only the coordinator of the cluster will write to the cache store. So, basically, unless the coordinator is an owner or backup for that data, it won't be written. This could be improved of course...