tracker issue : CF-3126318

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

cachePut creates non-existent region

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

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

Created: 02/29/2012

Components: Caching

Versions: 10.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: Public Beta / 281708

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 0

Currently, this creates the "NonExistentRegion" region: cachePut("id", "value", 1, 1, "NonExistentRegion")

Based on our previous discussions about regions (where it was decided that an exception should be thrown if the region doesn’t exist), then that should throw a region-doesn’t-exist exception instead of creating the region.

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

Watson Bug ID:	3126318

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

Attachments:

Comments:

Related thread: http://prerelease.adobe.com/r/?3c1d6f0b5ebc4d1686c786ed93eb6e38
Comment by External U.
20481 | February 29, 2012 04:40:30 AM GMT
During discussion, it was noted that this would break backward-compat w/ CF9 (cfcache/cachePut allow creation of non-existent regions). So, considering this CF10 scenario: 1) cacheRegionNew("myRegion", {custom properties here}, ...) creates custom region 2) at a later time, cacheRegionRemove("myRegion") removes the custom region And considering this code: cachePut("id", "value", 1, 1, "myRegion") If that cachePut() is called before #2, then it is cached based on the custom properties. However, if cachePut() is called after #2, then it is cached based on the default properties in ehcache.xml. Syntax suggestion: cachePut("id", "value", 1, 1, "myRegion", true) That last parameter is "throwOnError". Default is false (for backward compat w/ CF9). When true, a region-doesn’t-exist exception is thrown if the region does not exist. It would be a backward compatible way to prevent cachePut() from creating a region. It’d allow us to be certain that the object/query is being cached according to the expected region config (instead of default region config, for non-existent region).
Comment by External U.
20482 | February 29, 2012 10:10:58 AM GMT
Verified this is fixed in CF10 Final (build 10,282462). Thanks! -Aaron
Comment by External U.
20483 | May 28, 2012 06:00:36 PM GMT