tracker issue : CF-4198816

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

Changes to cached query results are persisted back into cache

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Victor Bondarenko / Victor Bondarenko ()

Created: 06/01/2017

Components: Database, CFQuery

Versions: 2016

Failure Type: Data Corruption

Found In Build/Fixed In Build: 2016,0,04,302561 / 303574

Priority/Frequency: Normal /

Locale/System: / Linux

Vote Count: 2

Listed in the version 2016.0.05.303689 Issues Fixed doc
Problem Description:

Changes to cached queries are persisted back into the cache. Earlier versions of ColdFusion did not do this.

Steps to Reproduce:

Sample code:

<cfquery datasource="ds" name="rs" cachedwithin="#createtimespan(0,0,5,0)#">
        SELECT 123 AS value

<cfset rs.value = 999>

<cfquery datasource="ds" name="rs" cachedwithin="#createtimespan(0,0,5,0)#">
        SELECT 123 AS value


Actual Result:


Expected Result:


Any Workarounds:



This needs to get fixed and be released. I didn't find this when reporting bug #CF-4198980, so I'm upvoting it here too.
Vote by James M.
631 | July 12, 2017 01:40:50 PM GMT
+1 - And I'd also put repro code as comments on CF-4198980. Thanks for the fast resolution! Could the patch be attached to this ticket when ready? Customers should apply it ASAP. I'd put "Failure Type" as "Data Corruption".
Vote by Aaron N.
632 | July 12, 2017 09:18:20 PM GMT
James/Aaron, Here's the link to the early access patch: MD5 checksum: 97cdae9fe74f3670e74c1e477b8c5a9c Steps to apply this patch: 1. Stop the ColdFusion service. 2. Navigate to <cf_install_dir>/<instance_name>/lib/updates 3. Place the downloaded jar. 4. Start the ColdFusion service. NOTE: This patch should be applied on top of CF2016 Update 4. The fix for this issue will be included in the upcoming update of ColdFusion 2016. -Nimit
Comment by Nimit S.
623 | July 13, 2017 05:12:52 AM GMT
I installed this (Windows 2016. CF 2016,0,04,302561 Update Level = "/C:/CFusion/cfusion/lib/updates/hf201600-4198816.jar"), but I'm getting the same incorrect caching results. The sample code I'm using (which can use any generic SQL datasource) is available at (I've uploaded a screenshot of query dumps to CF-4198980.) I even modified the CFAdmin "Server Settings | Caching | Use internal cache to store queries" options and it didn't make any difference. I also used the admin to clear the query cache between tests. (I also restarted the server.) The caching bug does not appear to be fixed with this patch. Aaron, Have you had any success w/Linux?
Comment by James M.
624 | July 13, 2017 03:55:03 PM GMT
Thanks James for sharing the feedback. Please try steps mentioned below: 1. Delete *.class files located inside <cf_install_dir>/<instance_name>/wwwroot/WEB-INF/cfclasses. 2. Restart ColdFusion service.
Comment by Nimit S.
625 | July 13, 2017 05:52:41 PM GMT
I've deleted all files in the "C:\CFusion\cfusion\wwwroot\WEB-INF\" sub-directory and restarted the ColdFusion service. (I did this twice to ensure that I did it correctly.) Nothing changed. The retrieval of the cached query still returns the modified data instead of the initial cached query.
Comment by James M.
626 | July 13, 2017 06:16:13 PM GMT
James, Can you please share the ColdFusion settings summary with me? Email:
Comment by Nimit S.
627 | July 13, 2017 06:32:15 PM GMT
The fix appears to be working on an Ubuntu 14.04 install. Unfortunately, I was unable to reproduce the issue with added columns persisting pre- or post-fix.
Comment by Victor B.
628 | July 14, 2017 08:38:03 PM GMT
Apparently bug #CF-4198980 is not a duplicate. These two (2) methods work in CF2016 to update a query value and be properly recached: <cfset rs.value = 2016> <!--- this method is only capable of updating the first row's value ---> <cfset QuerySetCell(rs, "value", 2016, 1)> This popular method doesn't work in CF2016 (but does in CF8, 9, 10, & 11): <cfset rs.value[1] = 2016> Refer to bug #CF-4198980 for sample code:
Comment by James M.
629 | July 19, 2017 03:39:50 PM GMT
This issue is fixed now. The fix will be available as part of an upcoming update of ColdFusion 2016.
Comment by Nimit S.
630 | August 21, 2017 04:10:57 PM GMT