Previous topic Next topic  

CacheFieldsFetchMode ( nWA, nMode ) -> nPrevFetchMode

The function sets the mode to retrieve the record/field values from the server. It returns the previous settings.

<nWA> The workarea handle obtained by Select() command. Because it is not a workarea method of the RDD, it is mandatory to supply this argument.

<nMode> The mode to retrieve data values from the server. This could be one of the following two modes:


CACHE_FIELDS_FETCH_MODE_RECORD - The default and per standards of other RDD's like DBFCDX.


CACHE_FIELDS_FETCH_MODE_FIELDS - To force CachéRDD to pull values from the server per field basis.

Both methods have merits and demerits. In per record basis, all the fields are read from the server just with first call to a field value request for a particular record. This makes application to make a single trip to the server for all fields but increases the transportation overload and network traffic. On the otherhand, in per field basis, only field value requested is fetched from the server thus reducing the transportation overload but increases the number of trips to the server corresponding to number of fields being fetched for a particular record. You need to experiment with both under different scenarios. In my experiments CACHE_FIELDS_FETCH_MODE_RECORD has proved to be faster, but I am sure I might not been able to test it all possibilities.

The function is depricated for now. CACHE_FIELDS_FETCH_MODE_RECORD is active currently. I was experimenting with such behavior and then found that on RDBMS levels it is always faster to make fewer trips to the server than transferring a larger data in one shot.