It sure is easier to let CF handle the caching of queries and the speed is
great, we don't bother with loading it into any scope, just include the
query into local scope.
To handle refreshing we use two methods:
1. "manual" refresh by setting a flag on the URL which changes the
CachedWithin to 1 second, causing the query to refresh.
2. "automatic" by having the templates which modify the underlying data
hitting a query refresh template with CFHTTP with a timeout of 1 to prevent
waiting.

HTH,
Noam

        ----------
        From:  Bert Dawson [SMTP:[EMAIL PROTECTED]]
        Sent:  Wednesday, 18 April 2001 14:07
        To:  Fusebox
        Subject:  RE: Setting Query as an Application Var

        just set the NAME attribute of cfquery tag to "application.whatever"
(the
        same works for other scopes).
        However, if you're going to stick it in the application scope you're
going
        to have to lock it whenever you reference it...
        You might be better off ptting it in the request scope and using
query
        caching, 
        eg 
        <cfquery datasource="#request.dsn#" 
                 name="request.myquery" 
                 cachedwithin="#request.mytimespan#">
                SELECT   this
                FROM     that
        </cfquery>

        Then you'll have to work out how to refresh it, but then you'd have
to do
        that anyway if you were putting it in the application scope....

        Bert


        > -----Original Message-----
        > From: Trent Shepherd [mailto:[EMAIL PROTECTED]]
        > Sent: 18 April 2001 12:54
        > To: Fusebox
        > Subject: Setting Query as an Application Var
        > 
        > 
        > Hi Guys and Gals
        > I am looking to set the result of a query to an appliaction 
        > variable. This will be for a menu item.
        > Can anybody tell me whether this can be done and/or show me 
        > sonme examples of code.
        > 
        > Thanks in Advance
        > 
        > Trent Shepherd
        > Nemas
        > 
        > 
        >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to