Andrew, I realise I'm jumping in late, so apologies if this has already been 
mentioned, or I'm completely wrong.

I think the query name needs to be more unique. If your server runs another 
query with the same name but different SQL, the cache will be overwritten. 

Maybe do a search thru you code base for another query with the same name. Or 
rename the query, ie: qCountOfHorsesInRace#raceNo# (just an example)

>From the docs: "To use cached data, current query must use same SQL statement, 
>data source, query name, user name, password."

Cheers.

ps: maybe you could ride a horse down to the Melbourne user group ;)

On 21/06/2011, at 6:01 PM, "Peter Tilbrook" <peter.tilbr...@gmail.com> wrote:

> But it shouldn't go back to the database to check if it's changed, if it's 
> truly cached.  What would be the point of caching, if it had to check anyway?
> 
> Yes – it should. Because you are caching results that do not change for a 
> long time. The CACHEDWITHIN is a measure of how long CF will store a QUERY 
> until it is notified that a cached query has changed – it does this 
> automatically.
> 
>  
> 
> So.
> 
>  
> 
> 1.      CF request a QUERY from your database server.
> 
> 2.      DB sends back result and CF caches it – for 5 or how many hours.
> 
> 3.      Multiple request made to DB and CF gets same result so uses the cache 
> instead. All good.
> 
> 4.      But one single requests alters the DB response. CF caches the new 
> result. This new result is now the CACHE result.
> 
> 5.      All good no more changes for 5 hours. At 5:15 a new query to DB. 
> Cache has expired. DB responds. CF creates a new CACHE with that result.
> 
>  
> 
> That in a nutshell is how is works.
> 
>  
> 
> Only been using CF for 16 years next month so am I right?
> 
>  
> 
>  
> 
> On 21 June 2011 17:53, Peter Tilbrook <peter.tilbr...@gmail.com> wrote:
> 
> If the QUERY result changes (the result) the CACHE changes. This is the
> point. If the query has NOT changed CF will use what is stored. Otherwise it
> re-requests the data from the database server.
> 
> ColdFusion is NOT a database server. Your database returns a result to
> ColdFusion based on what CF request. If the database server itself says "the
> results are different now" than obviously the result given to CF is now
> changed. Hence a new QUERY.RESULT and a NEW AND UPDATED cache.
> 
> Get it?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "cfaussie" group.
> To post to this group, send email to cfaussie@googlegroups.com.
> To unsubscribe from this group, send email to 
> cfaussie+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/cfaussie?hl=en.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "cfaussie" group.
> To post to this group, send email to cfaussie@googlegroups.com.
> To unsubscribe from this group, send email to 
> cfaussie+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to