cfset structDelete(session.cart, url.sku)
/cflock
-Original Message-
From: Dave Watts [mailto:dwa...@figleaf.com]
Sent: Wednesday, September 09, 2009 5:19 PM
To: cf-talk
Subject: Re: Quick question on cflock...
Except for the fact that session.cart appears to be a struct, and lock
Brad or Dave... I take it that I don't want to have one unique name, eh?
Would it make more sense to do something like the code snippet below? A
combination of a descriptive phrase and a unique identifier? Thanks, Che.
cflock name=sessioncart-#session.sessionid# type=exclusive
timeout=20
If you are on CF8+, then my understanding is that locking READ functions is
no longer required. If you're still on CFMX 7, then, yes, cfif
arrayLen(session.customer.custerrors) is a READ function and should be
locked.
Or was it is CFMX 7 that made the READ lock less important?
On Wed, Sep 9, 2009 at 11:04 AM, Jason Fisher ja...@wanax.com wrote:
If you are on CF8+, then my understanding is that locking READ functions is
no longer required. If you're still on CFMX 7, then, yes, cfif
arrayLen(session.customer.custerrors) is a READ function and should be
locked.
: Wednesday, September 09, 2009 2:05 PM
To: cf-talk
Subject: re: Quick question on cflock...
If you are on CF8+, then my understanding is that locking READ functions is
no longer required. If you're still on CFMX 7, then, yes, cfif
arrayLen(session.customer.custerrors) is a READ function and should
Thanks for the clarification, Charlie. Something in the back of my mind
was hollering CF7 at the end of that last post, which is what made me
post that last caveat. Your point about the race conditions is the key,
definitely. In most of my apps, the chance of a race condition within the
On CF8, following Charlie's response earlier, you do NOT need a READ lock,
unless you think there could be race conditions (a pending Ajax call that
writes the var you're trying to read, for example). If you DO need to
lock, then, yes, the lock would go *outside* of the CFIF statement, since
Muchas gracias... thanks Jason... thanks for the affirmation...
-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com]
Sent: Wednesday, September 09, 2009 2:22 PM
To: cf-talk
Subject: RE: Quick question on cflock...
On CF8, following Charlie's response earlier, you do NOT need
I think it was CFMX 7 that made it less important.
Actually, no, that was CF 6.x.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore,
What is the best pratice when in comes to using cflock looking at the code
snippets below? Basically does a session-based cfif block need to be
nested within a cflock or not? I'm pretty sure it does. Thanks, Che
cflock timeout=20 throwontimeout=No type=READONLY scope=SESSION
cfif
...@figleaf.com]
Sent: Wednesday, September 09, 2009 2:46 PM
To: cf-talk
Subject: Re: Quick question on cflock...
Third, you DON'T WANT TO LOCK AN ENTIRE SCOPE! This is why God* gave us
named locks. In CF 5 and earlier, you had to lock the scope to prevent
serious problems unrelated to the actual
This all depends on what the some code here... does.
Let's be clear on what people mean when they say cflock is less
important now. cflock is no longer required to ensure that memory does
not get corrupted and variables aren't read at the same time they are
being written.
That being said,
Dave, would this be a better approach? Also, can you use any name you want
as long as you are consistent? See below. Thanks, Che
cflock name=#session.cart# type=exclusive timeout=20
cfset structDelete(session.cart, url.sku)
/cflock
Yes, that would be a better approach, and yes, you
Except for the fact that session.cart appears to be a struct, and lock
names must be a string. You might want to take off those pound signs.
:)
~Brad
Original Message
Subject: Re: Quick question on cflock...
From: Dave Watts dwa...@figleaf.com
Date: Wed, September 09, 2009
Except for the fact that session.cart appears to be a struct, and lock
names must be a string. You might want to take off those pound signs.
:)
Except that if you remove the hashes, you'd have a single name
session.cart for all shopping cart locks across all sessions. D'oh!
Dave Watts, CTO,
15 matches
Mail list logo