[thelist] CFLOCK help request

Raymond Camden jedimaster at macromedia.com
Fri Jun 7 09:58:00 CDT 2002

It looks the server is set to require locking - so you need to add a
lock around the entire cfif block - because isDefined is like a read.

Unfortunately, you may also do a write inside, so, things get a bit
complex. Here is my rewrite, it's just one of the ways you can do it.

<cflock scope="session" type="readOnly" timeout=3>
	<cfif isDefined("session.calendarID") and session.calendarID neq
		<cfset variables.needUpd=1>

<cfif isDefined("variables.needUpd")>
	<cflock scope="session" type="exclusive" timeout=3>
		<cfset session.calendarID = attributes.calendarID>
		<cfset client.optionsSet = "no">
		<cfinclude ....>

> <CFIF IsDefined("Session.CalendarID")>
> 		<CFIF #Session.CalendarID# NEQ #Attributes.CalendarID#>
> 			<CFLOCK name="Session.CalendarID" timeout="10">
> 				<CFSET Session.CalendarID =
> #Attributes.CalendarID#>
> 			</CFLOCK>
> 			<CFSET Client.OptionsSet = "no">
> template="/calendar/common/act_options.cfm">
> 		</CFIF>
> 	</CFIF>


> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org] On Behalf Of Susan Wallace
> Sent: Thursday, June 06, 2002 11:31 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] CFLOCK help request
> Greetings!
> I inherited a CF application that was customized for one
> site, and is being
> moved to a new server. The application was written using
> CFLOCK in this manner:
> <CFLOCK name="Session.UserID" timeout="10">
> The server this was moved to throws an error (I'll outline in
> a sec) and
> when I inquired about the server settings for Locking, the
> reply I got was
> "The server is set for full locking."....
> So, in the way of troubleshooting I loaded the main page, got
> the error:

More information about the thelist mailing list