Since the advent of CFMX 6.1, the Macromedia specs state (no time to
find a URL, it's moving day 3) that shared-scope variables that will
be set once and contain a static value (i.e. static data available to
the entire app... like a DSN) do not need to be locked. Race
conditions and deadlocks were eliminated, so the only reason to use a
lock is to prevent data corruption... as long as your DSN isn't going
to change there isn't a reason to lock it.

At least according (I believe this is where it is) the LiveDoc for the
cflock tag under 6.1.

Also, even tho I'm sure this has already been stated, setting an
application variable in a cfparam tag is a fine idea, but changing the
default isn't going to change the value until you've deleted the
original... because application variables are persistent, and because
the cfparam tag doesn't fire to create the var unless it doesn't
already exists, the only way to change the value is either to delete
it... or, something I've done often is to put a cfif in
application.cfm that looks for a URL variable to fire off some CFSETs:

<cfif isDefined("URL.reloadAppScope")>
<cflock scope="application" type="exclusive" timeout="20">
<cfset application.appVar1 = 1>
{more cfset tags to write your app vars}
</cflock>
</cfif>

And that's my own two cents...

Laterz,
J


-- 
Continuum Media Group LLC
Burnsville, MN 55337
http://www.web-relevant.com


On Wed, 29 Dec 2004 09:50:30 -0000, Martin Parry
<[EMAIL PROTECTED]> wrote:
> You can most certainly store the datasource in an application variable.
> 
> Assuming you have a whole bunch of app vars that you will be using
> throughout your application. Andrew is correct in what he is saying
> about using request scope as you don't need to lock the application
> scope EVERY time you want to use it.
> 
> Instead you can use something like:-
> 
> <cflock scope="APPLICATION" type="READONLY" timeout="10"
> throwontimeout="Yes">
>         <cfset Request.Application = duplicate(Application)>
> </cflock>
> 
> Martin Parry
> Macromedia Certified Developer
> http://www.BeetrootStreet.co.uk
> 
> -----Original Message-----
> From: Andrew Grosset [mailto:[EMAIL PROTECTED]
> Sent: 29 December 2004 05:16
> To: CF-Talk
> Subject: Re: STICKY Application.datasource
> 
> Unless it's really necessary I would try not to set "datasource"
> as an application variable, either:
> 
> <cfset datasource="CODAGenomics">
> 
> or
> 
> <cfset request.datasource="CODAGenomics">
> 
> Andrew.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188932
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to