At 04:14 PM 7/28/00 -0400, Ben Forta wrote:
>Mike,
>
>I've been watching this thread with interest, and I stand behind my comments
>in the CFDJ column (which were reviewed thoroughly by Allaire programmers).
>
>I did say that if you were absolutely sure that variables would never change
>then you'd not need to lock them. But I also added that there is no real way
>to truly prevent variables from being written to (there is no concept of a
>constant) and so to be safe a READONLY lock should be used.
Even if you are not changing the variables, there may be problems with how
CF works internally. I don't know the details, but here's what I asked
Simeon Simeonov about locking:
>You wrote in the CF forums (11/6/98): "Whenever you use Session variables
>(read or write) that are not simple values you should use
>the CFLock tag." What did you mean about the "not simple values" part? I
>thought I had to use CFLOCK around all read/writes to shared variables.
and here was his response:
>[Sim] This applied to CF 4.0 and covered you in 99% of the cases but was not
>bullet proof; at certain times CF internally could look at some of the
>shared scopes and cause a problem. In 4.5 you should lock around every
>access (read, write, lookup) to shared data. If you do this you will be 100%
>protected.
I assume that CF 4.5 could do internal housekeeping as well...
Gregory M. Saunders, Ph.D.
Senior Design Architect
Cognitive Arts Corporation (http://www.cognitivearts.com)
1840 Oak Avenue, 4th Floor
Evanston, IL 60201-5914
>-----Original Message-----
>From: Mike Amburn [mailto:[EMAIL PROTECTED]]
>Sent: Friday, July 28, 2000 4:06 PM
>To: [EMAIL PROTECTED]
>Subject: FW: CFLOCKs.... is this really necessary? - hold on a sec
>
>
>-----Original Message-----
>From: Mike Amburn [mailto:[EMAIL PROTECTED]]
>Sent: Friday, July 28, 2000 3:46 PM
>To: [EMAIL PROTECTED]
>Subject: RE: CFLOCKs.... is this really necessary? - hold on a sec
>
>
> > > http://www.sys-con.com/coldfusion/archives/0208/Forta/
> > >
> > > I think Ben explains this pretty good here.
>
>unfortunately, his article completely contradicts some of the statements
>made earlier in this thread. Ben says:
>
>"...CF developers typically create variables in the APPLICATION scope...and
>are careful never to overwrite them. If an application contained variables
>like this, variables that were never updated (after initial creation), you
>wouldn't really need to lock them at all."
>
>so according to Ben Forta, the only time you need to lock an application
>variable is when you are changing the value (i.e. CFSET), *NOT* when you are
>simply reading it (i.e. CFOUTPUT). But Zack said in a previous reply:
>
>"IT IS AN ABSOLUTE NECESITY THAT YOU LOCK ALL SESSION, APPLICATION, AND
>SERVER VARIABLES WHEN YOU WRITE OR READ THEM."
>
>i will say that this is one thing that our organization is struggling
>with... in almost every question, someone says one thing and someone else
>says another. there doesn't seem to be much agreement anymore in the
>community. perhaps this is because allaire has changed CF so much with 4 and
>4.5, but it certainly doesn't look good when i research something like
>CFLOCK and create a standard to use it only to find out that someone else is
>saying otherwise.
>
>anyone else feel like this?
>
>-mike
>
>
>------------------------------------------------------------------------------
>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.