tracker issue : CF-3144420

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

[Caching Enhancements - Regression] : The "lastupdated" field of cacheGetMetadata() is set to the "lasthit" and "createdtime" field even if the object in the cache is not updated

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/AsDesigned

Reporter/Name(from Bugbase): / ext-user (Kavya Maiya)

Created: 03/22/2012

Components: Caching

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: 282058 /

Priority/Frequency: Normal / Few users will encounter

Locale/System: English / Win XP All

Vote Count: 0

Problem:
[Caching Enhancements - Regression] : The "lastupdated" field of cacheGetMetadata() is set to the "lasthit" and "createdtime" field . This is not correct since the field "lastupdated" should be set only if the object in the cache is updated. 

This is happening in the recent build. Was passing on build : 281957

Method:
1. Execute the test cases:
http://10.192.36.59/cfsuite/coldfusion/tags/page-processing/cfcache/caching_enhancements/get/pos/app/cfcache-get-metadata-lastUpdated-app-pos-13.cfm
http://10.192.36.59/cfsuite/coldfusion/tags/page-processing/cfcache/caching_enhancements/get/pos/cfcache-get-metadata-lastUpdated-pos-06.cfm
http://10.192.36.59/cfsuite/coldfusion/tags/page-processing/cfcache/caching_enhancements/get/pos/cfcache-get-metadata-lastUpdated-pos-13.cfm

Sample test case:
	<!--- metadata keys to test --->
		<cfset key = "lastupdated">
    
		<!--- clear all caches --->
        <cfif ArrayLen(cacheGetAllIds()) gt 0>
			<cfset cacheRemove(ArrayToList(cacheGetAllIds()))>
		</cfif>
		
		<!--- create a unique cache id so that each time a new cache is created --->
		<cfset id = createUUID()>	
     
        <!--- put something in the cache --->
        <cfcache action="Put" id="#id#" value="some_value" timespan="#CreateTimeSpan(0,0,0,30)#" idletime="#CreateTimeSpan(0,0,0,30)#">

		<!--- get initial hit count  --->
        <cfset cacheMetadata = cachegetmetadata(id)>
		<cfdump var="#cacheMetadata#">

Here we can see that the "lastupdated" field is not 0. It should be 0 since the object in the cache is not being updated.

Result:

Expected:

Workaround:

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

Watson Bug ID:	3144420

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

Attachments:

Comments:

With ehcache 2.5.1 now the last access time aapi on element will return its creation time which was previously 0. So now in metadata lastupdatetime is same as creation time for a new element. (Comment added from ex-user id:sandeepp)
Comment by Adobe D.
20031 | March 22, 2012 08:03:55 AM GMT
This is fixed. CLosing this bug (Comment added from ex-user id:kamaiya)
Comment by Adobe D.
20032 | March 23, 2012 01:03:32 AM GMT
As discussed with Sandeep, with ehcache 2.5.1 the "lastupdated" field is same as the creation time for a new element. So adding a release note since this behavior is changed with Ehcache 2.5.1. Earlier it used to be 0. Updated the necessary test cases. Closing this bug. (Comment added from ex-user id:kamaiya)
Comment by Adobe D.
20033 | March 23, 2012 03:37:07 AM GMT