>    It is a documented best practice, and many will attest to the
experience.
>    If you copy the variable to the local scope (as you suggest) you do not
> have to lock the local variable.  However, why are you storing the
variable
> in the application scope if you are going to copy it into the variables
> scope on each page request?
>   Also, copying the variable into the local scope does not negate the need
> to lock the application scope.

That's why, as I mentioned in another response to this thread, I don't use
application variables -- I use an included constants file and set
local-scope variables on each page call. It's no secret that the need to
lock the reading/writing of shared-scope variables in CF versions prior to
MX was a server architecture flaw on Allaire/Macromedia's part. In my
opinion, this flaw negated the convenience of using application variables.

Also, I never said that you didn't need to lock the application scope. In
code that I've inherited where shared-scope variables are used, my first
order of business is *always* to check for proper locking. Rather, I just
said that you don't need to lock an *entire query* because your datasource
name is set to a application-scope variable (though I still want to
reiterate that race conditions are a different matter).

Regards,
Dave.
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to