Question

Just installed Windows Server AppFabric 1.1 on my Windows 7 box and I'm trying to write some code in a console application against the cache client API as part of an evaluation of AppFabric. My app.config looks like the following:

  <configSections>
    <section name="dataCacheClient"     type="Microsoft.ApplicationServer.Caching.DataCacheClientSection,     Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral,     PublicKeyToken=31bf3856ad364e35" allowLocation="true" allowDefinition="Everywhere" />
  </configSections>
  <dataCacheClient>
  <hosts>
    <host name="pa-chouse2" cachePort="22233" />
  </hosts>
</dataCacheClient>

I created a new cache and added my domain user account as an allowed client account using the Powershell cmdlet Grant-CacheAllowedClientAccount. I'm creating a new DataCache instance like so:

using (DataCacheFactory cacheFactory = new DataCacheFactory())
{
  this.cache = cacheFactory.GetDefaultCache();
}    

When I call DataCache.Get, I end up with the following exception:

ErrorCode<ERRCA0017>:SubStatus<ES0006>:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.)

I'd be very grateful if anyone could point out what I'm missing to get this working.

Was it helpful?

Solution

Finally figured out what my problem was after nearly ripping out what little hair I have left. Initially, I was creating my DataCache like so:

using (DataCacheFactory cacheFactory = new DataCacheFactory())
{
  this.cache = cacheFactory.GetDefaultCache();
}

It turns out that DataCache didn't like having the DataCacheFactory created it disposed of. Once I refactored the code so that my DataCacheFactory stayed in scope as long as I needed my DataCache, it worked as expected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top