tracker issue : CF-4132238

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

Add cachedUntil option to query-related tags and functions

| View in Tracker

Status/Resolution/Reason: Needs Review//

Reporter/Name(from Bugbase): Carl Von Stetten / Carl Von Stetten (Carl Von Stetten)

Created: 03/25/2016

Components: Database

Versions: 11.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Minor / Some users will encounter

Locale/System: ALL / Win 2012 Server x64

Vote Count: 1

Problem Description: 

There are currently two ways to specify how a query is stored in cache from within query - cachedWithin and cachedAfter.  Using cachedWithin and specifying a TimeSpan allows you to specify a fixed duration that the query will live in the cache, starting from when the query is first called.  Using cachedAfter and specifying a date allows you to have the query continue to make database calls until the date specified, at which point it starts pulling the query results from the cache.

There is no direct way, however, to specify that a query in cache expire at a specified time.  I propose a cachedUntil attribute that would take a date/time value, and would purge a query from the cache either when that date/time is reached, or on the next time that specific query is called after the date/time has passed.

Steps to Reproduce:

Try to set a specific cache expiration date/time for a query from <cfquery> or queryExecute().

Actual Result:

Can't be done without workarounds.

Expected Result:

Query successfully expires from cache at specified date/time.

Any Workarounds:
    1. Create a scheduled task to run at the desired time to empty the entire query cache,
    2. Use the cacheID attribute with the cacheRegion attribute) and then use a scheduled task to delete the specific ID's from that cacheRegion (unless you can delete items directly from the normal QUERY region),
    3. Calculate a TimeSpan by subtracting Now() from the desired time/date of the cache removal.
    4. Any other method I haven't thought of.

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

Watson Bug ID:	4132238

External Customer Info:
External Company:  
External Customer Name: Carl Von Stetten
External Customer Email:  
External Test Config: My Hardware and Environment details:

Applies to all platforms, not just Windows Server.



+1 - Could attribute be named "CachedBefore"? If CachedBefore is before CachedAfter, then query is always cached except between CachedBefore and CachedAfter. If CachedAfter is before CachedBefore, then query is only cached between CachedAfter and CachedBefore. If CachedBefore and CachedAfter are the same value, then they are both ignored.
Vote by External U.
3225 | April 28, 2016 03:55:55 PM GMT