Search code examples
wcfappfabric

Sometimes DataCache.GetObjectsInRegion() return an emply list while objects are present in the region


I'm using AppFabric caching in a WCF service hosted in WAS. I must do something wrong because sometimes GetObjectsInRegion() return an empty list while objetcs are indeed present in the region.

Unfortunately, I'm not able to identify the context in which the problem is reproductible. It seems though that if the web service is restarted, existing regions are seen empty for the service.

Im sure that this is not tied to a timeout problem.

I'll update the question if there is any progress on my side.

Any help appreciated.


Solution

  • This one was a bug on my side. I was not explicitely setting expiration timeout in some circumstances. The cache cluster was configured with default expiration settings. The TTL is 10 minutes. Objetcs were automatically removed from the cache.

    The takeway is : Always set an expiration timout when putting objetcs in the cache.