since the Request Scope is non-persistent.
Change that "Request" to "Application" and everything you say is
completely correct. ;^)
Jim Davis
-----Original Message-----
From: Peter Tilbrook [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 9:05 PM
To: CF-Talk
Subject: RE: Application and Request scope
But remember when setting vars in the Application.cfm file they are
reset on
every request for a .cfm template so test to see if a var exists first
and,
if not, set them all in one go, eg:
<cfif not isdefined("Request.ApplicationVersion")>
<cfparam name="Request.ApplicationVersion" default="1.0" type="string">
<cfparam name="Request.ApplicationInspiration" default="My name is
Forrest,
Forrest Gump." type="string">
<cfparam name="Request.MacromediaRoadshow" default="Why did they ignore
the
capital city of Australia (ie: Canberra) when Adobe had more than 300 at
their Acrobat 6.0 launch?" type="string">
</cfif>
etc.
CF will see that Request.ApplicationVersion is or is not already defined
and
setup the vars once only.
Peter Tilbrook
ColdFusion Applications Developer
ColdGen Internet Solutions
Manager, ACT and Region ColdFusion Users Group (http://www.actcfug.com)
4/73 Tharwa Road
Queanbeyan, NSW, 2620
AUSTRALIA
Telephone: +61-2-6284-2727
Mobile: +61-0439-401-823
E-mail: [EMAIL PROTECTED]
World Wide Web: http://www.coldgen.com/
-----Original Message-----
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 1 October 2003 10:52 AM
To: CF-Talk
Subject: RE: Application and Request scope
If you're on CFMX locking the Session/Application/Server scopes is not a
stability issue as it was in 4.5/5.0 - but it is needed to prevent race
conditions. However if you're using them in a "read-only" manner (and
you're on MX) then locking isn't needed. In 4.5/5.0 locking is needed
to maintain server integrity.
For your App information - that's up to you. I might suggest, at the
very least, using the REQUEST scope for them - that way they're
available to all custom tags as well.
Broadly speaking I generally recommend for users of MX to store this
stuff in the Application scope: you can read the information with no
locking and it uses less system resources under load. For CF 4.5/5.0 I
would say use the Request scope: not having to lock everything is well
worth the system resources used by repeating the information for each
request.
Jim Davis
-----Original Message-----
From: cfhelp [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 9:37 AM
To: CF-Talk
Subject: RE: Application and Request scope
I read this and now I am questioning my Application.
I have been building a document Library system. The Application is
shared
between all the sites using it by Virtual Directories.
I use session variables in the login.cfm to set the User information
(GUID,
Directory, IsAdmin) after login authentication.
<cfset SESSION.Auth = StructNew()>
<cfset SESSION.Auth.Email = QryCheckLogin.Email>
<cfset SESSION.Auth.UserGUID = QryCheckLogin.UserGUID>
<cfset SESSION.Auth.LibraryGUID = QryCheckLogin.DocLibOwnerGUID>
<cfset SESSION.Auth.IsLoggedIn = 'YES'>
<cfset SESSION.Auth.Admin = '#App_Admin#'>
I am not locking the above.
Everything seems to be working when multiple users are on the site (on
the
same website or sharing). I also named the Application dynamically by
<cfset AppName = #ListGetAt(CGI.HTTP_Host,'2','.')#>
<cfapplication name="DocumentLibrary#AppName#"
sessionmanagement="Yes"
setclientcookies="Yes"
sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
applicationtimeout="#CreateTimeSpan(0,0,30,0)#">
Then I just use cfparam to set variables.
<cfparam name="App_DataSource" default="TheDatabase">
<cfparam name="App_DataBaseUser" default="TheUserName"><!---
<cfparam name="App_DataBasePass" default="ThePassword">
<cfparam name="App_Admin" default="NO">
<cfparam name="APP_Path" default="#expandPath('../../../../')#">
<cfparam name="APP_LibraryOwnerURL" default="#CGI.HTTP_Host#">
Should I use Application Variables?
Should I be locking them?
Rick
_____
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 7:36 AM
To: CF-Talk
I explain this pretty thoroughly in my guide to CF variables here:
http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Guides/V
<http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Guides/
V
<http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Guides/
V%3e> >
ariables/Index.cfm
I'm sure other people have other (perhaps better) opinions but that
should give you the skinny at least.
Jim Davis
-----Original Message-----
From: Paul Wilson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 8:08 AM
To: CF-Talk
Subject: Application and Request scope
I've been reading a few threads that advise on storing various things
(that's a technical description btw) in the
application or request scope. Why is this a good idea and what things
should be stored there?
_____
[Todays
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

