At 12:17 PM 6/26/2002 -0400, you wrote: > > First you have to put it into an application variable, so code similar >to > > this goes into the Application.cfm : > > > > <cflock> > > <cfif isDefined("Application.dsn")> > > <cfset application.dsn = "mydatasource"> > > </cfif> > > </cflock> > > > > > > Now you have to lock all your query statements every time you reference > > the variable: > > > > <cflock> > > <cfquery datasource="#application.dsn#"> > > > > </cfquery> > > </cflock> > > > > > > In this case, you have added additional locking code, which takes > > additional processing time, with no real added benefit for storing the > > datasource information in an application variable. > >I disagree with that example. There is no reason to have to lock the entire >query just to use the application variable.
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. -- Jeffry Houser | mailto:[EMAIL PROTECTED] Need a Web Developer? Contact me! AIM: Reboog711 | Fax / Phone: 1-203-379-0773 -- My CFMX Book: <http://www.amazon.com/exec/obidos/ASIN/0072225564/instantcoldfu-20> My Books: http://www.instantcoldfusion.com My Band: http://www.farcryfly.com ______________________________________________________________________ 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists