The way I usually do it, is to quickly CFLOCK (as readonly) the session variables and 
copy them into local variables.

Then use the local variables later on the page (in IF statements and what not).

That way as little as code as possible is inside the CFLOCK tag block.

hth,
Brian Simmons
[EMAIL PROTECTED]
ColdFusion 4.5 Certification testing tool, CF_Buster:
http://www.centrasoft.com

---------- Original Message ----------------------------------
From: "Hayes, David" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: Wed, 11 Apr 2001 13:54:05 -0500

>I think you want to handle it more like this:
>
><CFSET includeItP = false>
><CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="10">
>       <CFIF session.value EQ 0>
>               <CFSET includeItP = true>
>       </CFIF>
></CFLOCK>
>
><CFIF includeItP>
>       <CFINCLUDE TEMPLATE="somecfml.cfm">
></CFIF>
>
>
>-----Original Message-----
>From: Terry Bader [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, April 11, 2001 1:32 PM
>To: CF-Talk
>Subject: LOCKING
>
>
>ok, question about locking....
>
>let's say I have code like this:
>
><CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="10">
>       <CFIF session.value EQ 0>
>               <CFINCLUDE TEMPLATE="somecfml.cfm">
>       </CFIF>
></CFLOCK>
>
>And somecfml.cfm might possible need to write to the session scope.
>
>Now, my question is, does the Lock in the calling cfm page follow down into
>the included page?
>
>
>just wondering because with a complex Conditional statement checking against
>session variables, though you may be only reading from the session scope
>while running the checks, you might just have to write to the session scope
>somewhere inside....
>so if the lock does follow the INCLUDES then I guess the whole thing will
>have to be EXECLUSIVELY locked...
>
>
>       Terry Bader
>       IT/Web Specialist
>       EDO Corp - Combat Systems
>       (757) 424-1004 ext 361 - Work
>       [EMAIL PROTECTED]   
>
>
>       (757)581-5981 - Mobile
>       [EMAIL PROTECTED]
>       icq: 5202487   aim: lv2bounce
>       http://www.cs.odu.edu/~bader

>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to