Locking in CF5 (and earlier) was used for 2 reasons - to prevent the
server from getting... err... confused (and crashing) and for 'logical'
reasons. You no longer need to use cflock to prevent the server from
crashing. However you may still need to use locks for logical reasons.

Example 1:
Imagine Application.DSN stored your datasource. This value is set once
and never changes. Therefore, you don't need to lock the creation or use
of it. You did in CF5.

Example 2:
You store the # of hits to the site in Application.Hits. Your
Application.cfm file does:

<cfset application.hits = incrementValue(application.hits)>

It's possible that two threads could run this code at the same time.
Instead of starting off w/ 10 and ending up w/ 12, you would end up w/
11. So, a lock could be used to ensure that you get the correct data.

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Jim McAtee [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, July 08, 2002 2:16 PM
> To: CF-Talk
> Subject: Re: nuther lockin Q?
> 
> 
> How has locking changed in CFMX so that it's no longer 
> required in this
> situation?  I haven't been following many of the CFMX 
> discussions since we
> have no immediate plans to move to that platform.
> 
> Jim
> 
> 
> ----- Original Message -----
> From: "Raymond Camden" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Monday, July 08, 2002 12:07 PM
> Subject: RE: nuther lockin Q?
> 
> 
> > If CF5: Repeat after me (again): If I _type_ session (or 
> application or
> > server), I type lock. Using that rule, yes, you need a lock.
> >
> > <cflock scope="session" type="readOnly" timeout=3>
> > your code
> > </cflock>
> >
> > In CFMX, I would not use the lock.
> >
> > 
> ==============================================================
> =========
> > Raymond Camden, ColdFusion Jedi Master for Macromedia
> >
> > Email    : [EMAIL PROTECTED]
> > Yahoo IM : morpheus
> >
> > "My ally is the Force, and a powerful ally it is." - Yoda
> >
> > > -----Original Message-----
> > > From: Critter [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, July 08, 2002 1:57 PM
> > > To: CF-Talk
> > > Subject: nuther lockin Q?
> > >
> > >
> > > oi CF-Talk,!!
> > >
> > >   I've got this on a few pages:
> > >
> > > <cfif not isDefined("Session.Auth.iUserID") or
> > > Session.Auth.iUserID eq "">
> > >         <cflocation url="../logout.cfm?reason=sessiontimeout"
> > > addtoken="no">
> > > </cfif>
> > >
> > > would  that  still  "qualify"  for a lock? and if so would I
> > > just lock the whole
> > > <cfif> ?
> > >
> > > --
> > > Critz
> > > Certified Advanced Bald White Barefoot ColdFusion Developer
> > >
> > > Crit[s2k] - <CF_ChannelOP Network="Efnet" Channel="ColdFusion">
> 
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to