If you want an application variable initialized as the very first thing the site does, 
what file is guaranteed to be run first before anything else? Application.cfm.

But you dont want it to re-initialize the variable every time a page is requested, so 
you surround it with a test:

CFLOCK Application
        CFIF IsDefined Application.mythingamajiggie
                CFSET Application.mythingamajiggie = mydata
        /CFIF
/CFLOCK

At 01:46 PM 11/15/00 -0600, Mary Fowler wrote:
>I thought application.cfm is read every time there is a request to the CF
>server?  Why would anyone set an application scope in the application.cfm
>file? Application scopes have nothing to do with application.cfm? Right?
>
>I just finished Advanced CF Development a couple of weeks ago and Bruce Van
>Horn, our instructor, said it was good practice to lock ALL application,
>session and server scope variables. Either you lock them all or don't bother
>with any.
>
>A little confused,
>:)mary
>
>
>
>-----Original Message-----
>From: David Shadovitz [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, October 11, 2000 1:00 AM
>To: CF-Talk
>Subject: Locked App Scope vs. Request Scope
>
>
>I have followed the various threads on locking Application scope
>variables and on the use of the Request scope, but I still have a
>question.
>
>I create and populate an Application-scope structure in Application.cfm.
>This is done only once, when the application is first initialized.  I use
>this structure on many pages, within a readonly lock.
>
>I know that I could copy (via Duplicate) the structure into the Request
>scope and omit the lock.
>
>Which method is better?  For what regime does Duplicate beat CFLOCK?  I
>imagine this would be a function of the structure's complexity and of the
>number of CFLOCK calls.
>
>(A variation of the Request scope method would be to create/populate the
>structure directly in the Request scope, eliminating usage of the
>Application scope.  But it seems to me that this would be slower than
>simply copying it from the Application scope into the Request scope.)
>
>Thanks.
>-David
>
>P.S. My Allaire Developer Conference *unofficial* sign-ip sheet has been
>moved to
>www.cfm-resources.com/d/dshadovi/index.html. If you're coming, sign up!
>________________________________________________________________
>YOU'RE PAYING TOO MUCH FOR THE INTERNET!
>Juno now offers FREE Internet Access!
>Try it today - there's no risk!  For your FREE software, visit:
>http://dl.www.juno.com/get/tagj.
>----------------------------------------------------------------------------
>--
>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]/
>Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
>with 'unsubscribe' in the body to [EMAIL PROTECTED] 


---------------------------------------------------------------------------
Peter Theobald, Chief Technology Officer
LiquidStreaming http://www.liquidstreaming.com
[EMAIL PROTECTED]
Phone 1.212.545.1232 x204 Fax 1.212.545.0938

To put this contact information into your Palm device, click here:
http://www.coola.com/cgi-bin/addinfo.cgi?pid=15803&rid=972879910&type=A


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

Reply via email to