I'm re-posting my list of CFLOCK questions, with a few new questions added
to the list.  


1) Should calls to CFOBJECT be locked?  Does it depend on the particular
type of object, and if so, do I need to lock CLASS="Word.Application", and
how would I know in general which classes need to be locked?  


2) Someone (I think Michael Dinowitz) once recommended: "use CFLOCK on all
direct network calls  (CFHTTP, CFFTP, etc. NOT CFMAIL)."  Does this include
CFFILE?  How about CFDIRECTORY?

Actually, I found part of the answer to this question in the manual:

    Using CFLOCK around file manipulation constructs can guarantee that file 
    updates do not fail due to files being open for writing by other
applications
    or ColdFusion tags.

Does this mean that you do NOT have to lock CFDIRECTORY?  Also, I
understand the part about preventing writing by other CF tags, but I don't
understand the part about preventing failure due to other apps having the
file open, especially given the sample syntax in the docs, which uses just
the name of the file:

    <CFLOCK NAME=#FileName# TIMEOUT=60 TYPE="Exclusive">
        <CFFILE ACTION="Append"
           FILE=#FileName#
           OUTPUT=#TextToAppend#>
    </CFLOCK>



3) And someone else (I think Michael Sheldon) once said:

>...there is still a very good reason to CFLOCK a CFLOCATION.
>Any time the page you are transferring to depends on a value being set in
>the originating page, CFLOCK is almost mandatory. Otherwise, the
>multi-threading nature of CF may perform the CFLOCATION *before* the
>variables are set or a query is complete, which could *royally* hose the
>next page. Granted, this is usually only a major problem when network
>latency is extremely low (local LAN), but I have seen it enough times to
>know it is a very subtle GOTCHA.

I don't understand this at all.  If I have:

   File1.cfm:
      <CFLOCK TIMEOUT="60" SCOPE="SESSION" TYPE="Exclusive">
         <cfset session.name = "greg">
      </CFLOCK>
      <cflocation url="file2.cfm">

   File2.cfm:
      <CFLOCK TIMEOUT="60" SCOPE="SESSION" TYPE="ReadOnly">
         <cfoutput>name=#session.name#</cfoutput>
      </CFLOCK>

How can the CFLOCATION be performed BEFORE the <cfset session.name =
"greg"> is executed?  What would the lock around cflocation look like, and
how would it prevent the problem?



4.  Has anyone tested CFLOCK's "throwOnTimeout" flag?  I have a frameset
with 2 frames, and inside each is:

   <CFLOCK TIMEOUT="1" SCOPE="SESSION" TYPE="EXCLUSIVE" throwOnTimeout="no">
      <CFX_SLEEP SLEEPTIME=2>
      I'm inside the lock.<br>
   </CFLOCK>
   I'm outside the lock.

This code will throw an error in one of the frames regardless of the value
of throwOnTimeout.



5.  Do you have to cflock this:   isDefined("application.foo")?   I assume
not, but want to make sure.



Gregory M. Saunders, Ph.D.
Senior Design Architect
Cognitive Arts Corporation (http://www.cognitivearts.com)
120 S. Riverside Plaza, Suite 1520
Chicago, IL 60606

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
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.

Reply via email to