How to destroy the client local region (only) with Native Client Generic API
search cancel

How to destroy the client local region (only) with Native Client Generic API

book

Article ID: 294249

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

If you execute the following C# code with GemFire Native Client, all the region entities in the client's local region are destroyed, as well as, those in the server side region.

regionObject.DestroyRegion();

Sometimes, however, you may want to destroy the client's local region only, without destroying the server side region. Prior to the introduction of the GemFire Native Client's Generic API, you could do this in C# code using the following, non-Generic API:

regionObject.DestroyLocalRegion();

However, this method does not exist in the Native Client Generic API, and the non-Generic API has been deprecated since Native Client 7.0.x. This article introduces how to accomplish the same behavior with the Native Client Generic API.


Environment


Resolution

In order to destroy the only the client's local region using the Native Client Generic API, you must get a local view from the region object using the GetLocalView method. After that, you can simply destroy it using an approach like the following:

regionObject.GetLocalView().DestroyRegion();


Additional Information

Environment 

ProductVersion
Native Client3.6.x or later version of Generic API