Will SESSION variables being set by one user "clobber" another users variables are are they "unique" to each individual user that accessing my application?
--Original Message Text---
From: Tony Weeg
Date: Tue, 7 Oct 2003 10:51:26 -0400
if you are setting session vars, use EXCLUSIVE
if you are reading from the value of a session variable, use READONLY
make sense?
its really kinda easy when you think about it like this....
...tony
tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337
-----Original Message-----
From: Bushy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 10:50 AM
To: CF-Talk
Subject: RE: application.cfm
So then putting a <cflock around all my <cfset SESSION.variable(s) within my
application.cfm is acceptable?
What <cflock syntax would I use around all my <cfset
SESSION.variable_name(s)?
I'm getting confused on "READONLY" and "EXCLUSIVE".
My application will be accessed by 20-50 users. Does this make a difference?
When my app is run by a user I run a <cfquery and define all my SESSION
variables which are the database fields. Should I be using something other
than SESSION variables for this? Each SESSION variable will be "unique" for
every user.
<cflock timeout="2" throwontimeout="No" name="name" type="READONLY"> <cfset
SESSION.variable1="something"> <cfset SESSION.variable1="something"> <cfset
SESSION.variable1="something">...etc.
</cflock>
--Original Message Text---
From: Jim Davis
Date: Tue, 7 Oct 2003 10:42:23 -0400
Well - not really - it won't single thread the application - at least as
long as you END the lock (and end it as quickly as possible). ;^)
However it will lock (get it!) the session scope WHILE you're writing to (or
reading from) it. As a general rules of thumb the only things inside a
CFLock should be CFSETs - don't place your query in there, don't place the
<CFIF> in there, etc.
Performance won't be affected (at least in any noticeable sense) and you'll.
Jim Davis
-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 10:25 AM
To: CF-Talk
Subject: RE: application.cfm
I think you should beware using <cflock> in your application.cfm file,
especially if you set it to EXCLUSIVE, this will essentially make your
application a ONE THREADED application. since application.cfm is a "RUN ON
EVERY PAGE REQUEST" file, this may cause unwanted results.
just a caveat.
...tony
tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337
-----Original Message-----
From: Bushy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 10:22 AM
To: CF-Talk
Subject: RE: application.cfm
Are you saying I should put a <cflock around all my SESSION.variable that
I'm defining with <cfset?
If so, whats the default <cflock?
Something like this (in the Application.cfm). This assumes that you're
using the session scope on CFMX - if you're using CF 5 or below you should
lock the accesses to the session scope to prevent server
instability:
<cfif NOT IsDefined("Session.Init")>
<cfquery name="myQuery"...>
Your query
</cfquery>
<!--- Do whatever you have to do with your variables You might only set the
results of the query into the session scope like this: ---> <cfset
Session.myQuery = myQuery>
<!--- Now set your marker variable - once this is done this section of code
won't run on the next request for this user ---> <cfset Session.init =
true>
</cfif>
There are actually many other ways to do this. One that you might look into
if you're only caching the query (and using it as it's returned) is to cache
the query using the CachedWithin and CachedAfter attributes of CFQuery.
Once you set these if the SAME EXACT query is run again before the refresh
period CF will pull the information from the cache and not bother hitting
the database.
This makes for VERY fast access of the cached query and a very simple page
(no marker variables or persistent scopes needed). There are limitations -
you read the docs on this, but it may be the way to go.
Jim Davis
-----Original Message-----
From: Bushy [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003 11:49 AM
To: CF-Talk
Subject: re: application.cfm
HI,
I need to load my database fields into session and cookie variables for my
application. The catch is I only need <cfquery the database once upon
initial log in via Windows NT authentication. I don't want the datbase
queried if a "refresh" is performed. Where or how can I do this. Sould the
<cfquery be in my application.cfm off the main root of the website?
/inetpub/wwwroot/website/application.cfm
________________________________
_____
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

