Connie
Personally I've tended to store my global settings in an
application-scoped struct, but duplicate them into request scope for
unlocked usage, like this:
<cfset bSetup = false>
<cflock scope="APPLICATION" timeout="10" type="ReadOnly">
<cfif not isDefined( "application.settings")>
<cfset bSetup = true>
</cfif>
</cflock>
<cfif bSetup EQ true>
<cfscript>
strSettings = structNew();
strSettings.dsn = "(whatever)";
// etc
</cfscript>
<cflock scope="APPLICATION" timeout="10" type="Exclusive">
Application.settings = Duplicate( strSettings );
</cflock>
</cfif>
<!--- duplicate settings into request scope --->
<cflock scope="APPLICATION" timeout="10" type="ReadOnly">
<cfset request.settings = Duplicate( application.settings ) />
</cflock>
You can then read the settings from request scope without having to
worry about locking.
Hope that helps
Alistair
Alistair Davidson
Senior Technical Developer
Headshift.com
Smarter, Simpler, Social
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- CFLOCK Scott Wilhelm
- Re: CFLOCK Ryan
- Re: CFLOCK Christian Cantrell
- RE: CFLOCK Mike Brunt
- Re: CFLOCK Fregas
- RE: CFLOCK Ben Doom
- Re: CFLOCK Dave Lyons
- RE: CFLOCK AEverett
- CFLOCK Connie Archari
- RE: CFLOCK Raymond Camden
- RE: CFLOCK Alistair Davidson
- RE: CFLOCK Paul Vernon
- RE: CFLOCK Pascal Peters
- RE: CFLOCK Alistair Davidson