Well, I had been assuming that <cfset application.countries = getcountries> 
only set a pointer and that application.countries then had the same scope 
as getcountries.  This is apparently only so for "complex data types like 
structures" (whatever they are other than structures) according to Allaire.

best,  paul

At 05:43 PM 10/1/00 -0400, you wrote:
>On 10/1/00, paul smith penned:
> >I hope this is so.  If it is, then naming the query Request.MyQuery
> >eliminates the need for a LOT of locking downstream compared to naming the
> >cached query Application.MyQuery.
> >
> >BTW, contrary to Alliare's Best Practices, I find for CF 4.01 the option of
> >naming a query Application.MyQuery instead of Request.MyQuery means you
> >need to use CFLOCK like so:
> >
> ><CFLOCK NAME="Application.AppName" etc
> >
> ><CFQUERY NAME="Application.MyQuery" etc
> >
> >blah, blah
> >
> ></CFQUERY>
> >
> ></CFLOCK>
>
>I must be missing something. Why would you want to name a query
>application.MyQuery, or with any scope for that matter? What's wrong
>with just naming it MyQuery?
>
>Again, am I missing something, or are you getting confused with
>stroring the query results in the application scope? For instance,
>say you have a query that always queries for a list of countries,
>which will never change, then you would do:
>
><cfif not isdefined('application.countries')>
><cfquery name="getcountries"
>select country
>from countries
></cfquery>
><cfset application.countries = getcountries>
></cfif>
>
>Then the query will only run the first time it's accessed after it's
>been purged from memory and you'll access it with:
>
><cfoutput query="application.countries">
>#country#<br>
></cfoutput>
>--
>
>Bud Schneehagen - Tropical Web Creations
>
>_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>ColdFusion Solutions / eCommerce Development
>[EMAIL PROTECTED]
>http://www.twcreations.com/
>954.721.3452
>------------------------------------------------------------------------------
>Archives: http://www.mail-archive.com/[email protected]/
>To Unsubscribe visit 
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or 
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in 
>the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to