Thank you Zac, that made a whole lot of sense.
So henceforth I'll lock everything except data that never changes like
Application.DSN, i.e. data that only gets set if Not IsDefined... If it's
not defined, no other process can be accessing it.
One final thing? Should locks be wrapped around "large" chunks of code that
mention say a session variable/s several times? How large a chunk would you
consider reasonable to lock? Or is it better to have a zillion locks each
wrapped around one reference to a variable?
Interesting to note that in the CF docs (the HTML ones, anyway) they've
replaced <cflock name...> with <cflock scope...> in the examples but they
haven't really changed the text to match. Perhaps they used their automatic
wizard.
http://127.0.0.1/CFDOCS/Developing_Web_Applications_with_ColdFusion/12_Using
_the_Application_Framework/dwa12_15.htm
e.g.
<!--- Initialize the session and application
variables that will be used by E-Turtleneck. Use
the session lock for the session variables.
The member variable sessionID creates the
session name for you. --->
<CFLOCK SCOPE="Session"
TIMEOUT="30" TYPE ="Exclusive">
<CFIF NOT IsDefined("session.size")>
<CFSET session.size = "">
</CFIF>
<CFIF NOT IsDefined("session.color")>
<CFSET session.color = "">
</CFIF>
</CFLOCK>
------------------------------------------------------------------------------
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.