GemStone.GemFire.Cache.NotConnectedException (2041452)
GemStone.GemFire.Cache.NotConnectedException
using GemStone.GemFire.Cache; ...... CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(); Cache cache = cacheFactory .AddServer("localhost", 40404) .SetPRSingleHopEnabled(true) .SetSubscriptionEnabled(true) .Create(); RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY); Region region = regionFactory.Create("exampleRegion"); region.Put("111", "112233");
An exception occurred: GemStone.GemFire.Cache.NotConnectedException: Region::put: not connected to GemFire ---> GemStone.GemFire.Cache.GemFireException: No stack available. --- End of inner exception stack trace --- at GemStone.GemFire.Cache.Region.Put(CacheableKey key, Serializable value, IGFSerializable callback) at GemStone.GemFire.Cache.Region.Put(CacheableKey key, Serializable value) at Examples.HelloWorld.Main() in C:\kyoinstall\Gemfire\TestCenter\TradingScreenGemfire7\Client\test1\application\client\HelloWorld\HelloWorld.cs:line 51 ---[ Press <Enter> to End the Application ]---
Sample code conversion
//namespace change using GemStone.GemFire.Cache.Generic; ...... CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(); Cache cache = cacheFactory .AddServer("localhost", 40404) .SetPRSingleHopEnabled(true) .SetSubscriptionEnabled(true) .Create(); RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY); //Region-->IRegion IRegion<String, String> region = regionFactory.Create<String, String>("exampleRegion"); //Using the generic IDictionary API or by using the .NET Region.Put region[strKey] = strValue;