Using an Index to Access the Cache

When you use an index to access the cache, the keys in the index that are sent to the API must correspond to the keys of the index used in the call to jdeCacheInit or jdeCacheInitEx for that cache in number, order, offset positions, and type. Therefore, if a field that was used in the index passed to jdeCacheInit or jdeCacheInitEx offsets position 99, it must also offset position 99 in the index structure that passed to JDECACHE access API.

You should use the same index structure that was used for the call to jdeCacheInit or jdeCacheInitEx whenever you call an API that requires an index structure.

The next example illustrates why the index offsets must be specified for the jdeCacheInit or jdeCacheInitEx and how they are used when a record is to be retrieved from the cache. It describes how the passed key is used in conjunction with the JDECACHE internal index definition structure to access cache records.