> 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?
If you know absolutely that the object you're referencing is thread-safe,
you shouldn't need CFLOCK. If not, then you do.
> > ...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?
CF, while it generally seems like a batch language where everything executes
from top-to-bottom, is actually a bit more complex, I think. I know that
when you use a CFLOCATION tag, CF stops looking for tags to process, and
immediately sends the HTTP header back to the browser. I also know that the
CF engine does perform some tasks asynchronously, so that it may actually
start executing the CFLOCATION before the previous CFSET has completed. The
server would then start processing the browser's next request. As Mike
Sheldon noted, this is pretty rare, but it does happen, and it's one of
those wacky things that's hard to track down.
> 5. Do you have to cflock this:
> isDefined("application.foo")? I assume not, but want to make sure.
You wouldn't think you'd have to lock this, but it is a read, and according
to the one guy on Earth who should know:
"Simeon Simeonov wrote:
> IsDefined() cannot be used on shared variables without locking!
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
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.