0

To answer this question I am using the Pivotal Native Client to create many local client caches so each local client cache would have their own Listener. I come up against a problem which is that from the QuickStart example after the cache, pool and region factory are created as default no matter what kind of RegionShortcut is used for example .LOCAL or any other

RegionFactory rf = c.CreateRegionFactory(RegionShortcut.LOCAL);

then:

IRegion<string, string> region = rf.SetPoolName(poolName).Create<string, string>("exampleRegion");

is fine for the 1st instance of a client cache, but once any other is attempted as another local client cache then that code above gives the error:

An unhandled exception of type 'Apache.Geode.Client.RegionExistsException' occurred in Pivotal.Gemfire.dll

Additional information: Cache::createRegion: "exampleRegion" region exists in local cache

So how can you create many local client caches within the same C# project?

rupweb
  • 3,052
  • 1
  • 30
  • 57
  • 1
    This looks like a bug. Recommend reporting it to the user's Geode list – Wes Williams Feb 05 '18 at 19:06
  • @WesWilliams thx 4 comment. Shall do so. Tho I guess new cache cd be done by new thread for each cache instead of new object instance... but then for a high freq app there will be even more context switches. Wd prefer Geode to manage context switches? – rupweb Feb 05 '18 at 19:45
  • In another case of the "region exists" error I had init the region before as `` and was trying to connect as `` – rupweb Sep 30 '21 at 13:50

1 Answers1

0

This happened again when the use of the region factory, and trying to subscribe to keys in a region was being done on a separate (background) thread to the cache and region initialization.

rupweb
  • 3,052
  • 1
  • 30
  • 57