Ok, what if you are using application variables as a part of the IF
statement and session in the IF? e.g:
<CFIF Application.Foo>
<CFSET Session.bar = 1>
</CFIF>
Is it ok to nest different types of Locks (session and application). And
what if Application.foo was actually session.foo? Would I need nested
session lock-ing or will the outer Lock around the if statement lock all
session variables with in?
Ben
-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: 10 July 2000 14:36
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: When should I use CFLOCK?
> After reading the Allaire KB article on locking, I put CFLOCK's
> around all instances of any session or server variables. The one
> place that seems a bit muddy is if the read is within a CFIF
> statement. I put the lock around the entire CFIF but is that
> required? I implied that it was from the KB article but I have
> never seen that specifc guidance anywhere.
If you're doing something like this:
<cfif IsDefined("Session.Foo")>
then it should be locked. On the other hand, if you're just referencing a
session variable within a CFIF:
<cfif Variables.Foo IS "bar">
<cfset Session.Foo = "baz">
</cfif>
then you could put the CFLOCK within the CFIF.
Lock 'em, Dano!
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.