tracker issue : CF-3846185

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: cacheRemove(cacheGetAllIds()) throws attribute validation exception

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 11/01/2014

Components: Caching

Versions: 11.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Very few users will encounter

Locale/System: English / Win All

Vote Count: 0

Listed in the version 11.0.03.292480 Issues Fixed doc
In CF11, cacheRemove()'s IDs parameter will also accept an array but won't accept cacheGetAllIDs()'s result array.

Repro:

<cfscript>
  arr1 = cacheGetAllIDs();
  arr2 = listToArray(arrayToList(cacheGetAllIDs()));
  if(arr1.equals(arr2)) {
    cacheRemove(arr1);//throws exception "Attribute validation error for the CACHEREMOVE function"
  }
</cfscript>

Workarounds:

<cfscript>
  cacheRemoveAll();//works
  cacheRemove(arrayToList(cacheGetAllIDs()));//works
  cacheRemove(listToArray(arrayToList(cacheGetAllIDs())));//works
</cfscript>

Verified in 11.0.0.289822 and 11.0.03.291742.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3846185

External Customer Info:
External Company:  
External Customer Name: itisdesign
External Customer Email:

Attachments:

Comments:

This is only partially fixed in CF11 Update 3 (11,0,03,292024(PreRelease)). It still throws an exception if 1 or more queries has no cacheid attribute: <cfscript> cacheRemoveAll("query"); q1 = queryNew(""); q2 = queryNew(""); </cfscript> <cfquery name="q1" dbtype="query" cachedwithin="#createTimeSpan(0,0,1,0)#"><!--- causes exception b/c no cacheid attribute ---> SELECT * FROM q1 </cfquery> <cfquery name="q2" dbtype="query" cachedwithin="#createTimeSpan(0,0,1,0)#" cacheid="foo"> SELECT * FROM q2 </cfquery> <cfscript> writeDump(cacheGetAllIDs("query")); cacheRemove(cacheGetAllIds("query"), true, "query");//Exception: coldfusion.sql.QueryDetails cannot be cast to java.lang.String writeDump(cacheGetAllIDs("query")); </cfscript> Thanks!, -Aaron
Comment by External U.
10333 | November 08, 2014 06:41:09 AM GMT
That remaining issue was fixed in #CF-3849494. Thanks!, -Aaron
Comment by External U.
10334 | November 20, 2014 11:06:52 PM GMT