That won't cause a problem but it can be a little slow.  Generally you don't want 
anything but variables' assignments (cfset statements) inside a lock.  That's because 
since it's a shared scope, you're locking the entire application from using that scope 
for the time its used within this one lock.

That said, the only way to get around what you're doing is to move the session var 
into the request scope then check that. You can try it both ways to see how long they 
take, but there might not be much difference here.

BTW, <cfif picks> is a little faster than <cfif picks is "Yes">
The CFIF naturally evaluates to a Boolean, so you don't have to say "is YES"".

Chris Norloff


---------- Original Message ----------------------------------
from: "Yager, Brian T Contractor/Sverdrup" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
date: Wed, 31 Jul 2002 12:15:43 -0500

>Hello list..Another, hopefully, quick question.  
>
>Is there a problem with putting a cfif tag within a cflock?  Here is an example:
>
>  <cflock timeout="45" throwontimeout="No" name="look_pick" type="READONLY">
>    <cfif session.picks is "Yes">
>  </cflock>
>
>  Do insert
>
>  <CFELSE>
>  <CFLOCATION somewhere>
>  </CFIF>
>
>Would this cause any problems?
>
>Thanks for the help!
>
>Brian Yager
>President - North AL Cold Fusion Users Group
>http://www.nacfug.com
>Sr. Systems Analyst
>Sverdrup/CIC
>[EMAIL PROTECTED]
>(256) 842-8342
>
>
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to