> yes I am using (1) - copied and pasted the queries in to a separate
file and
> changed the creatimespan from 5 to 0.
> 
> so theoretically should be identical apart from the timespan -
changing this
> wouldn't prevent the query being cleared from cache would it - as this
is
> the whole point of the parameter isn't it? (or am i confused)

AFAIK, the SQL is pre-compiled before being executed (someone please
correct if wrong). Then, if there is a cached query of the same name
whose pre-compiled SQL matches the pre-compiled SQL of the query that's
it's about to executed, ColdFusion uses the recordset retrieved from the
previously executed query as long as the current date/time is within the
timespan associated with the previously retrieved statement. If not, it
re-runs the SQL and stores that as a newly cached query.

And the SQL it uses in the comparison is the bit inbetween the SQL tags,
so, no -- the fact that the cachedwithin attribute differs between the
two copies of your SQL won't make a difference.

Whilst what you say suggests that it should treat both SQL statements as
the same, I've only ever used a single SQL statement called from another
template, as I felt it was the best way to guarantee that the SQL was
identical -- you then don't have to worry about a trailing space or
accidental tab character preventing the SQL comparison from being true.

The easy way to test this is to enable debugging and view the SQL
activity. If ColdFusion is using a cached query, the length of time it
took to execute the query will show as "Cached" in the debugging output.

Hope this helps (and makes sense  ;-)


-- 
Aidan Whitehall <mailto:[EMAIL PROTECTED]>
Macromedia ColdFusion Developer
Fairbanks Environmental Ltd  +44 (0)1695 51775
Queen's Awards Winner 2003 <http://www.fairbanks.co.uk/go/awards>

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to