Hi, Jim,

How did you test the lock?  How did you determine when the lock released?

thanks,
Chris Norloff

---------- Original Message ----------------------------------
from: "Jim McAtee" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
date: Thu, 20 Dec 2001 17:44:08 -0700

>Looks like that's right.  I did a little testing and it appears that the
>lock is released immediately.  That makes life a bit simpler.
>
>Thinking about it some more, a cflocation always ends the HTTP request.  I

>imagine that CF may just release any locks set within a given request at t
he
>end of the request.  I wonder what happens in the cases of a cfbreak (exit

>from a loop) or a cfexit (exit from a custom tag) if they're also inside a

>cflock.  Maybe some more testing.
>
>Thanks,
>Jim
>
>
>----- Original Message -----
>From: "Bryan Love" <[EMAIL PROTECTED]>
>To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Thursday, December 20, 2001 5:01 PM
>Subject: RE: CFLOCK and CFLOCATION
>
>
>> Best guess:
>>
>> I'll bet that the lock is read first, then the variables are resolved,
>> then
>> the lock is released, then everything else happens (the cflocation
>> would
>> happen after the lock is released).
>>
>> +-----------------------------------------------+
>> Bryan Love
>>   Macromedia Certified Professional
>>   Internet Application Developer
>>   Database Analyst
>> Telecomunication Systems
>> [EMAIL PROTECTED]
>> +-----------------------------------------------+
>>
>> "...'If there must be trouble, let it be in my day, that my child may
>> have
>> peace'..."
>> - Thomas Paine, The American Crisis
>>
>>
>>
>> -----Original Message-----
>> From: Jim McAtee [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, December 20, 2001 3:43 PM
>> To: CF-Talk
>> Subject: CFLOCK and CFLOCATION
>>
>>
>> Is it OK to do a <cflocation url="..."> from within a cflock?  As in:
>>
>> <cflock type="readonly" scope="session" timeout="5"
>> throwontimeout="no">
>>   <cfif not IsDefined("session.userid")>
>>     <cflocation url="login.cfm">
>>   </cfif>
>> </cflock>
>>
>>
>> Or does this leave the lock in place?  If that's so, would the
>> recommended
>> workaround be to copy the session variable to a variables or request
>> scope
>> variable, something like this?
>>
>>
>> <cflock type="exclusive" scope="session" timeout="5"
>> throwontimeout="yes">
>>   <cfparam name="session.userid" default="0">
>>   <cfset request.userid = session.userid>
>> </cflock>
>>
>> <cfparam name="request.userid" default="0">
>>
>> <cfif request.userid eq 0>
>>   <cflocation url="login.cfm">
>> </cfif>
>>
>>
>> Jim
>>
>> 
>
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to