|
In latest versions of infinispan we can't configure cacheMode at something different to Configuration.CacheMode.LOCAL if transport is not set. So with a custom configuration of infinispan (ie, if we not use /org/hibernate/cache/infinispan/builder/infinispan-configs.xml) in a none clustered environment (ie withount any transport configured) we must set all cacheMode to LOCAL.
Now take a look at org.hibernate.cache.infinispan.query.QueryResultsRegionImpl.QueryResultsRegionImpl(CacheAdapter, String, Properties, TransactionManager, RegionFactory) :
this.localOnly = cacheAdapter.isClusteredInvalidation();
isClusteredInvalidation return true if
cacheMode == Configuration.CacheMode.INVALIDATION_ASYNC || cacheMode == Configuration.CacheMode.INVALIDATION_SYNC
So in my case, this.localOnly is equal to false which cause error describe above.
If I modify
this.localOnly = cacheAdapter.isClusteredInvalidation();
to
this.localOnly = cacheAdapter.isClusteredInvalidation() || cacheAdapter.getCache().getConfiguration().getCacheMode() == Configuration.CacheMode.LOCAL;
all works fine and queryCache is able to run without any TimeoutException issue.
Tested with hibernate 4.1.7
|