I generally set my application.cfm variables in request scope - ie request.dbname request.dbuser, request.dbpass etc. No locking issues that I'm aware of, and availible to custom components (which variable scope - IE just 'dbname, dbpass etc' isn't... or at least didn't use to be a few CF versions back ;>
With CFMX the cflocking necessities for shared scope handling are gone... so it ceases to be an issue I think. ----- Original Message ----- From: "Phil Evans" <[EMAIL PROTECTED]> To: "CFAussie Mailing List" <[EMAIL PROTECTED]> Sent: Friday, January 31, 2003 3:54 PM Subject: [cfaussie] Re: difficulties with application and session vars in CF > Hi All, > > Is there any real point in setting an application variable in the top level > application.cfm file. > If the <cfset application.DataSource = "dbname"> is going to be in each > application.cfm > file used in the system, then wouldn't it be smarter to just have > > <cfset DataSource = "dbname"> in application.cfm > > and reference it by > > <cfquery name="getUser" datasource="#DataSource#"> > > If your going to use an application variable, I would have thought it should > be > set up once in a login type of page, and not continually reset each time a > page is accessed. > > Also, if you're setting an application variable shouldn't it be inside a > cflock? > > Phil. > > > ----- Original Message ----- > From: "Geoff Bowers" <[EMAIL PROTECTED]> > Newsgroups: cfaussie > To: "CFAussie Mailing List" <[EMAIL PROTECTED]> > Sent: Friday, January 31, 2003 4:31 PM > Subject: [cfaussie] Re: difficulties with application and session vars in CF > > > > pete mawhinney wrote: > > > Its all in the top folder now and even though its win box I did the > > > Application.cfm rename for good measure. Still getting the same error > > > though. > > > > > > Here is an example of the useage: > > > <cfquery name="getUser" datasource="#APPLICATION.DataSource#"> > > > from authenticator.cfc > > > > > > and in Application.cfm is the line > > > <cfset DataSource = "dbname"> > > > > This needs to be: > > <cfset application.DataSource = "dbname"> > > > > And you need to make sure you have an appropriate <CFAPPLICATION> tag in > > Application.cfm > > > > Just read through the doco on "application" variables -- it is *NOT* a > > scope that is peculiar to Application.cfm *ALL* shared memory scope > > variables in SF must be scoped at all times (ie. application/session). > > > > -- geoff > > http://www.daemon.com.au/ > > > > > > --- > > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > > To unsubscribe send a blank email to > [EMAIL PROTECTED] > > > > MX Downunder AsiaPac DevCon - http://mxdu.com/ > > > > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MX Downunder AsiaPac DevCon - http://mxdu.com/ > --- You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/
