Tally List : mailing list management, archiving, and analysis
click for archive home
 
Archive of:
CF-Talk
Cold Fusion - Technical
 
home
24 hour view
quick stats
weekly updates
 
all tallylists
corporate solutions
archive your favorite
help / feedback


Search the Tallylist search by keyword:

About Cold Fusion :
product's home
product's list home
 
  Archived TallyList / CF-Talk: 
Subject: RE: structure in request scope
Patricia Lee (89p/+0r)     Posted: Sunday 13 May 2001
This post: 190 views, +0 rating

Problem is, then every page request you are running the query, which takes longer than to copy the recordset from the shared-server scope..... your way runs the danger of negating some of the time you would save by creating the query in the shared scope.

|-----Original Message----- |From: Paul Smith [mailto:paul.smith@support.net] |Sent: Friday, May 11, 2001 9:50 AM |To: CF-Talk |Subject: RE: structure in request scope | | |I find it easier and simpler to put the query in request scope |in the first |place (not really necessary) and cache it. That way, none of |the below is |necessary. | |best, paul | |At 09:27 AM 5/11/01 -0400, you wrote: |>And to wrap it all up |> |>You want to write the query in a persistent scope. But since |every time you |>write to or access a persistent scope you must lock the |access, you want to |>copy the query to the request scope in the application.cfm. |This way you |>will only nead to bother with the locking process when |creating the query |>and copying to the request scope. Everywhere else in your |site you'll call |>the request variable to access the query info... and you |won't have to use a |>lock. |> |>so your application.cfm would look something like this. |> |><!--- Create the query in a persistent scope ---> |><cflock scope="APPLICATION" throwontimeout="No" timeout="1" |>type="EXCLUSIVE"> |> <cfif NOT isdefined("application.myquery")> |> <cfquery name="application.myquery" |datasource="mydsn"> |> [SQL Stuff] |> </cfquery> |> </cfif> |></cflock> |> |><!--- Copy the query to the request scope ---> |><cflock scope="APPLICATION" throwontimeout="No" timeout="1" |type="READONLY"> |> <cfset request.myquery = duplicate(application.myquery)> |></cflock> |> |>|-----Original Message----- |>|From: Sean Daniels [mailto:sdaniels@marketplacetech.com] |>|Sent: Thursday, May 10, 2001 10:54 AM |>|To: CF-Talk |>|Subject: Re: structure in request scope |>| |>| |>|On 5/10/01 1:59 AM Mark Ireland wrote: |>| |>|> Could someone tell me how to load a structure into the |>|request scope in the |>|> application.cfm |>|> |>|> once only when a user first visits a page. That is, check that the |>|> structure is there and dont rerun the query code if it is |>|> |>|> unless a change has been made to the database. |>| |>|It sounds like you want to put the structure into a persistent |>|scope, which |>|request is not. Use the application scope instead if it is |>|global to all |>|users. If not, client or session scope. |>| |>|<cfif isdefined("application.strFoo")> |>| <cflock type="exclusive" scope="application" name="strLock"> |>| <cfset application.strFoo = structnew()> |>| <!--- etc ---> |>| </cflock> |>|</cfif> |>| |>| |>|- Sean |>| |> |


Similar Subject Line Posts (+/- two weeks of this post)
RE: structure in request scope  13 May 2001 (this post)   (190 v/ +0 r)
RE: structure in request scope  11 May 2001   (87 v/ +0 r)
RE: structure in request scope  11 May 2001   (99 v/ +0 r)
RE: structure in request scope  11 May 2001   (90 v/ +0 r)
RE: structure in request scope  11 May 2001   (83 v/ +0 r)
RE: structure in request scope  11 May 2001   (87 v/ +0 r)
RE: structure in request scope  11 May 2001   (102 v/ +0 r)
Re: structure in request scope  10 May 2001   (100 v/ +0 r)
RE: structure in request scope  10 May 2001   (113 v/ +0 r)
structure in request scope  09 May 2001   (94 v/ +0 r)
structure in request scope  03 May 2001   (98 v/ +0 r)
 

Send a reply to the CF-Talk list!
click to send a reply! NOTE: Many lists will reject your post unless you have already registered with them. Also - don't forget the right account to send from (for those with multiple emails!)

Feedback: If this post was exceptionally helpful, please help by giving this post a positive review.

 

TallyList : copyright Ububik - 2000