jdeCacheInit Initialization Failed

BrianR

Member
I am trying to add two additional indices to the Pay Category Hourly Rate Cache found in B0700067 (Xe). My changes are marked with "TASK285".

***************************************************
/* Set up Index to Pay Category Hourly Rate Cache */

/*Index1->nNumSegments = 3; */ /* TASK285 */
Index1->nNumSegments = 5; /* TASK285 */

Index1->CacheKey[0].nOffset = offsetof(DSHOURLYRATECACHE, cPayTypeCategory);
Index1->CacheKey[0].nSize = sizeof(dsHourlyRateCache.cPayTypeCategory);
Index1->CacheKey[0].idDataType = EVDT_STRING;

Index1->CacheKey[1].nOffset = offsetof(DSHOURLYRATECACHE, mnRateHourly);
Index1->CacheKey[1].nSize = sizeof(dsHourlyRateCache.mnRateHourly);
Index1->CacheKey[1].idDataType = EVDT_MATH_NUMERIC;

Index1->CacheKey[2].nOffset = offsetof(DSHOURLYRATECACHE, jdDtWorkJulian);
Index1->CacheKey[2].nSize = sizeof(dsHourlyRateCache.jdDtWorkJulian);
/* Changed data type to EVDT_JDEDATE - EW5926726 - 3/10/99 */
Index1->CacheKey[2].idDataType = EVDT_JDEDATE;

/* TASK285 - Begin */
Index1->CacheKey[3].nOffset = offsetof(DSHOURLYRATECACHE, szHRJobCategory);
Index1->CacheKey[3].nSize = sizeof(dsHourlyRateCache.szHRJobCategory);
Index1->CacheKey[3].idDataType = EVDT_STRING;

Index1->CacheKey[4].nOffset = offsetof(DSHOURLYRATECACHE, szHRJobStep);
Index1->CacheKey[4].nSize = sizeof(dsHourlyRateCache.szHRJobStep);
Index1->CacheKey[4].idDataType = EVDT_STRING;
/* TASK285 - End */
*****************************************************

When the following jdeCacheInit command is executed I get a jde.log entry that says "CAC0001077 - (jdeCachInit) Initialization error. Re-initialization with incorrect segment number" and no handle is returned.


****************************************************
/* Get Pay Category Hourly Rate Cache Handle */

jdeCacheCode = jdeCacheInit(hUser, &hHourlyRateCache, lpDS->szHourlyRateCache, Index1);
***************************************************

What am I missing??? Thanks.
 
Hello, Brian

On the jdeCache reference guide I found the following statement:

"More than one cache handles can be initialized by using the same cache name, but the ipIndex structure must be an exact match."

Perhaps the process is initializing another handle of that same cache with the original Index Structure.
If so, you should consider using jdeCacheInitMultipleIndex, witch should allow you to define more than one index structure.

Hope this helps!
Regards
 
Back
Top