[thelist] CF: Clearing a cached query?

Raymond Camden jedimaster at macromedia.com
Tue Oct 15 09:17:15 CDT 2002

Your tests are incorrect - and I should have been more clear.

If you run 2 queries with different white space, where the first query
has a time out of X minutes and the second query has a timeout of 0
minutes, you WILL see that the second query is not cached, ie, the debug
out does NOT show it being cached, however if you rerun the first query
AND it's within X minutes, it will still show the cached data. To prove
this, you need to update your tests. Run the first query, run the
modified second query with a 0 length timeout, then return the first and
verify that it is marked cached.

FYI, in your SQL Server test, your second query had a different name. CF
'marks' cached queries with their SQL _and_ their name, username,
password, basically all the attributes.

> no offense, but ewww.
> unless I'm reusing the query (which is another avoidable
> problem), putting a
> query in an include seems to add to disorganization, when there are
> perfectly viable solutions (like the one I presented).

This I strongly disagree with. What happens if you change your table
structure? Every file that uses the query then has to be updated. By
abstracting your queries, you make it much easier to update your code.
How is disorganized to move multiple queries in multiple files to one
query in one file?

Raymond Camden, ColdFusion Jedi Master for Hire

Email    : jedimaster at macromedia.com
WWW      : www.camdenfamily.com/morpheus
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org] On Behalf Of Morgan Kelsey
> Sent: Tuesday, October 15, 2002 10:04 AM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] CF: Clearing a cached query?
> Raymond,
> [deletia]

More information about the thelist mailing list