ClusteredTimestampsRegionImpl keeps a localCache that's not updated right after calling its put method. Calling the get just after the put will not return the value that was just added to the region. I understand that the value will not be available for other nodes of the cluster, but I was expecting that the value would be available, at least, to the cluster node that executed the put method. Is this by design?
The affected scenario:
I have 2 cluster nodes, but I'm accessing only 1 of them.
For the same transaction and "hibernate session", if I do the following:
Execute a query for entity A (that will be cached locally local-query)
Persist a new instance of entity A
Flush the entity manager/session
Execute the very same query again
Then I'll get old results. The persisted entity A is not returned, but it should be returned.
If I add a sleep of 100ms after the flush, the query will return the correct results. While debugging I realized that ClusteredTimestampsRegionImpl doesn't update its local cache right away during put and it will only be updated after nodeModified is called, the local cache is updated.
All these operations are executed in just one cluster node.
The infinispan configuration:
The partial code for the test case: