Pivotal Knowledge Base


The type limitation for the Native Client CQ methods of the Generic APIs

Applies to

GemFire 7 and later


This document adds the missing information regarding type limitations for Native Client CQ methods of the Generic APIs.


Currently, all methods related to Continues Query are declared the following way:

class CqQuery<TKet,TResult>

Following the usual concept of Generic in C#, in the above method the TKey and TResult could be any type of objects. However, if using objects which are not either of Object type or Structs in a CQ as the TResult, an exception will be shown in the Native Client log similar to the following:

Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'GemStone.GemFire.Cache.Generic.Struct' to type 'Customer.IResult'. The Customer.IResult could be any type of your own data type working as the TResult here.


Presently, the TResult parameter can only be a struct of any type of objects (so you can only use Struct) or a basic Object type. This limitation is documented in the description of this, and related methods, in later versions of GemFire.


Powered by Zendesk