[thelist] CF: Determining which DB used.

Joshua Olson joshua at alphashop.net
Wed Sep 12 13:16:21 CDT 2001


Jeff, Ray,

out of curiosity, how often do you find yourself using the global scopes
(application, server, etc) to store data rather than just initializing into
variables which expire at the end of the request?  I find a vast majority of
my variables are under a struct I call "app" or in the form or request
scope.  In those I don't have to worry about locking and they still seem to
work.  From a development standpoint it seems *much* quicker to have a
cfinclude file that does a bunch of cfsets to a "local" scope instead of
having to worry about locking all the dang time.

Obviously I am not talking about truly persistent session information and
static information pulled out of some horrific query and what not... just
everyday "I need this simple information in variables at some/every page
request" type information.

-joshua

----- Original Message -----
From: "Raymond Camden" <jedimaster at macromedia.com>
Subject: RE: [thelist] CF: Determining which DB used.


: My beef with this, and now we are getting into the anal stuff, so,
: folks, just do what you think is best here, is that you are using an
: exclusive lock for every request, and it is not necessary. Even though
: it's not as pretty, I do this:
:
: <CFSET NeedInit = 0>
: <CFLOCK SCOPE="Application" TYPE="ReadOnly" TIMEOUT=3>
: <CFIF NOT StructKeyExists(Application,"Init")>
: <CFSET NeedInit = 1>
: </CFIF>
: </CFLOCK>
: <CFIF NeedInit>
: <CFINCLUDE ...>
: (The file I include here has the exclusive lock)
: </CFIF>
:
: I puposely did NOT use Variables.NeedInit so I could pass URL.NeedInit
: as a way to refresh my app. A security hole, yes, but not a big deal if
: you aren't doing a lot of initialization.





More information about the thelist mailing list