I am having data consistency issues trying to make concurrent writes to the root node of a tree cache.
I am using infinispan version 5.1CR3.
I have used the following patterns:
Used putIfAbsent(key,data) and get(key)
TransactionManager tm = cacheManager.getTransactionmanager();
Configuration is as follows:
cache mode Distributed Async
isolation level Read commited
Transaction mode transactional
sync commit phase true.
Further will calls like getKeys() return all the keys of that cache in the cluster or return only keys that are present locally on the node? is there a way to get all the keys for a particular cache in the cluster?
We do not have l1 enabled but we find that getkeys returns only local keys. We do not have configuraition file we are starting caches dynamically using startCaches api. Also we are using the tree cache.
The data consistency issue happened because we try to get all the keys using getKeys or getAllChildren of treecache api expecting it to return clusterwide results. Since that results in local keys/children our code has data inconsistencies.