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

-----Original Message-----
From: KeAnne Hoeg [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 03, 2004 11:14 AM
To: CF-Talk
Subject: RE: Session Variables Suddenly Stopped Working

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?

>From: KeAnne Hoeg <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: Session Variables Suddenly Stopped Working
>Date: Thu, 03 Jun 2004 10:45:57 -0400
>
>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>
>
>
>
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to