>- see footer for list info -<
Simon, here are a few thoughts that may help. First, just to make sure we're on 
the same page, how is that you've
concluded that it's "forgetting" the cached query? It shouldn't result in any 
error, just a refresh of the cached result
because it's not there "now". There's no code-oriented or interface-oriented 
indication that this is happening. You say
there's an error, but there should never be one. 

If you're finding that an expected query result is "undefined", it means that 
you've not run the CFQUERY that would
define it. The cached query result feature (such as with cachedwithin) is 
different in that with it you should ALWAYS
run the CFQUERY, but the cache mechanism does its thing in the background, 
determining whether to do a real DB I/O. If
you're seeing the query being "undefined", I'd guess that some code is 
precluding the execution of the CFQUERY, which
would seem a mistake.

If instead this is really about cached results somehow being "lost" and a real 
DB I/O taking place when not expected,
one way this could happen is by the number of cached results reaching the max 
number of cached queries. One thing to
keep in mind is that a cached entry is kept not "per cached cfquery" but rather 
per set of unique sql generated within
each cached cfquery (and also further per unique combination of username, 
password, and connectionstring). 

So one could have a lot more cached querie resultsets than they think (thus 
reaching the limit). There's no visual
interface in CF to tell you how many cached queries you have, so it's a bit of 
a guessing game. (FWIW, BD's admin
console does tell you that info, both the number of query results in the cache 
and the hit count against them.)

Of course, another reason that the cached result could be "gone" is if the 
server was restarted. Since the cached
templates are stored in memory (in CF and by default in BD), a restart of the 
server would lose those. Again, as a
benefit, BlueDragon permits you to store the cached results on disk (to help 
solve this very problem, though obviously
at some increased cost in disk I/O to get the cached result, but the point is 
that you'd do this if it was cheaper than
doing real I/O to the DB).

Finally, you also talk about fixing the problem by setting that max cached 
queries value to 0. Is that to clear the
cache? Note that you can do that with the cfobjectcache (in both BD and CF): 
<cfobjectcache action = "clear">.

Hope some (if not all of) that helps.

Charlie Arehart
CTO, New Atlanta Communications, makers of BlueDragon
(678) 256-5395 [EMAIL PROTECTED]
www.newatlanta.com/bluedragon/

 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Simon Baynes
> Sent: Thursday, January 26, 2006 5:29 AM
> To: Coldfusion Development
> Subject: [CF-Dev] ColdFusion Forgetting Cched Queries
> 
> >- see footer for list info -<
> We keep having this problem where ColdFusion seems to forget 
> a query cached with cachedwithin.
> 
> I started getting this error that a query was undefined in my 
> CFC method. There was nothing wrong with the code, the only 
> way I could fix it was to set  Maximum number of cached 
> queries to zero and then set it back to what it was before.
> 
> This is really aggravating as I don't want to have to start 
> caching this query in a variable.
> 
> Has anyone come across this and found a solution?
> 
> Thanks.
> --
> Simon Baynes
> www.simonbaynes.com
> _______________________________________________

_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to