|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Session Variables Suddenly Stopped Working
Author: KeAnne Hoeg
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32967#165432
Thanks for the suggestion, Dave! We'll give that a try.
----- Excess quoted text cut - see Original Post for more -----
Author: Dave Carabetta
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32967#165425
----- Excess quoted text cut - see Original Post for more -----
KeAnne, I don't know the answer to your last question, but I'd like to make
a recommendation, if I may, as to your current setup.
The optimal setup with specific regard to your locking issue would be to
enable the strict locking checkboxes in the CF Administrator in your
*development* environment so as to force the developers to code better, and
then disable the checkboxes in production. The enabling of the features
results in a noticeable performance degradation, particularly under load. If
you enable the options in your development environment, you force your team
to code smarter and alleviate the need to for overhead in production.
I use ColdFusion MX now, so I haven't had to worry about this in a while.
But when I was on previous versions of CF, this approach resulted in
noticeable benefits -- 1) your team codes smarter and more proactively, 2)
your production site performance increases, and 3) proper locking will
alleviate the chances of clashes and race conditions, which is why you're
locking in the first place.
Hope this helps.
Regards,
Dave.
Author: KeAnne Hoeg
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32967#165411
I did talk to the server admin, and she hadn't changed any of the settings
recently, but when I checked the CF Administrator on our test site (which
works), I noticed that the locking information was set differently, so I
changed the lock settings in the production CF Administrator from "Full
Checking" to "No Automatic Checking", and that cleared up the problem
because the code uses the name attribute instead of the scope attribute.
What I find odd, however, is that this code and the production CF Admin
server settings have not changed in 2 years, meaning that the production
environment has been set to "Full Checking" for a long time, so why did it
suddenly throw the error yesterday?
----- Excess quoted text cut - see Original Post for more -----
Author: Semrau Steven Ctr SAF/IE
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32967#165406
You may want to see if the CF Admin set strict locking validation otherwise;
I don't really see why you would throw that error off-hand (assuming you are on
CF5?) however I would suggest some changes:
<cfapplication
name="solarcenter"
sessionmanagement="Yes"
clientmanagement="Yes"
applicationtimeout="#createTimespan(0,0,90,0)#"
sessiontimeout="#CreateTimespan(0,0,90,0)#">
Move the cfscript out of the application lock since you are dealing only with
session variables and create a session lock around them
<cflock timeout="5" throwontimeout="no" type="readonly" scope="session">
<!--- Log current user --->
<cfscript>
sUserInfo = StructNew();
sUserInfo.Address="#CGI.REMOTE_ADDR#";
sUserInfo.CFID="#session.cfid#";
sUserInfo.Token="#session.cftoken#";
sUserInfo.Address="#CGI.REMOTE_ADDR#";
sUserInfo.Time="#Now()#";
sUserInfo.Template="#CGI.CF_Template_Path#";
ID = "#session.cfid##session.cftoken#";
</cfscript>
</cflock>
Try changing from using the variable name #APPLICATION.applicationName# to just
the hardcoded name solarcenter and reduce the timeout value:
<cflock name="solarcenter" type="Exclusive" timeout="5"
throwontimeout="Yes">
<!--- If Session-Tracker does not exist, generate it --->
<cfparam name="APPLICATION.SessionTracker" default=#StructNew()#>
<cfset dummy = StructInsert(APPLICATION.SessionTracker, ID, sUserInfo,
true)>
</cflock>
Of course there is always the 'When in doubt - stop/start the CF service' :-)
Steve
I played with some of the error handling and was able to get a little more
information.
The message says "Application.applicationName is in a scope that contains
data shared across threads and cannot be accessed without an active lock".
I know very little about session variables and locking. Does that mean the
problem is with the lock itself?
----- Excess quoted text cut - see Original Post for more -----
_____
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32967#165407
Sounds like a change was made from the CF Admin -- a change that now
requires you to lock shared scopes. Locking >>
Server/Application/Session scope "Full Checking" would do this, I
think.
If you have to live with this global change in the CF Administrator
(shared host, or something), then lock all of your application/session
scope reads with read-only locks and lock all of your
application/session scope writes with exclusive locks. Same with
server scoped vars, though those are fairly unusual.
Jamie
On Thu, 03 Jun 2004 15:13:56 +0000, in cf-talk you wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Deanna Schneider
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32967#165403
Sounds like the server admins just turned on strict locking validation. Have
you talked to them?
> The message says "Application.applicationName is in a scope that contains
> data shared across threads and cannot be accessed without an active lock".
>
> I know very little about session variables and locking. Does that mean
the
> problem is with the lock itself?
>
Author: KeAnne Hoeg
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32967#165399
I played with some of the error handling and was able to get a little more
information.
The message says "Application.applicationName is in a scope that contains
data shared across threads and cannot be accessed without an active lock".
I know very little about session variables and locking. Does that mean the
problem is with the lock itself?
----- Excess quoted text cut - see Original Post for more -----
Author: KeAnne Hoeg
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32967#165394
I inherited a site that uses session variables to track users' paths through the
site and to handle the Admin login section. The code worked fine until yesterday
when it suddenly stopped working. The only information I get is "Processing
Error". Does anyone have any idea why it suddenly stopped working? One of the
admins was able to log in as recently as 6/1.
Here's the code in the Application.cfm file:
<cfapplication
name="solarcenter"
sessionmanagement="Yes"
clientmanagement="Yes"
applicationtimeout=#createTimespan(0,0,90,0)#
sessiontimeout=#CreateTimespan(0,0,90,0)#>
<cflock name="#APPLICATION.applicationName#"
type="Exclusive"
timeout="20"
throwontimeout="Yes">
<!--- If Session-Tracker does not exist, generate it --->
<cfparam name="APPLICATION.SessionTracker" default=#StructNew()#>
<!--- Log current user --->
<cfscript>
sUserInfo = StructNew();
sUserInfo.Address="#CGI.REMOTE_ADDR#";
sUserInfo.CFID="#session.cfid#";
sUserInfo.Token="#session.cftoken#";
sUserInfo.Address="#CGI.REMOTE_ADDR#";
sUserInfo.Time="#Now()#";
sUserInfo.Template="#CGI.CF_Template_Path#";
ID = "#session.cfid##session.cftoken#";
</cfscript>
<cfset dummy = StructInsert(APPLICATION.SessionTracker, ID, sUserInfo,
true)>
</cflock>
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||