Why did Allaire design Cold Fusion so you need to lock the variables
when you use them?  Why doesn't Cold Fusion take care of the threading
issues and locking?

My reasoning is this:
1) Much of the power of CF is it's ability to set session &
application variables.
2) According to all the threads I've read you are suppose to <cflock>
all access to session and application variables.
3) If you are suppose to lock all access to the variables, why not
then have Cold Fusion do it by default?

Am I, as I suspect I am, missing some crucial point on the concept?

very confused,

Dennis Powers
UXB Internet
(203)879-2844
http://www.uxbinfo.com

-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 30, 2000 10:10 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: A couple more cflock question

> Hi once again. I'm about to start going back (grrrr) and locking all
> my session, application variables, etc properly. Got a couple
> question.
>
> 1. Suppose I'm creations a session variable FROM session variables.
> For instance:
>
> I have: session.subtotal, session.tax, and session.shipping. I want
> to create a total:
>
> <cfset session.total = session.subtotal + session.tax +
> session.shipping>
>
> What kind of lock would go around that? Or would it be best to set a
> local variable inside a Readonly lock then set the session.total
> inside an exclusive lock from the local variable.

Just one TYPE="EXCLUSIVE" lock will do just fine for this. You don't
want to
make things more complicated than they need to be.

> 2. I've got a million instances of passing cfid and cftoken as
> session.id if cookies are turned off as per Ben Forta's examples in
> his book.
>
> a href = "somepage.cfm?#session.id#"
>
> That means I need to put a readonly lock around all of those,
> correct? My question is (actually a two part question).
>
> If I have a block of these, such as a text menu, should I put one
> lock around the entire block? Or should I lock each link separately?

If they're all together, you're probably better off locking them all
within
one lock.

> Part B of this question: Since I'm going through the hassle of
> checking for the existence of cookies, AND passing the session.id,
> would it be better to just pass
> cfid=#client.cfid#&cftoken=#client.cftoken# and not worry about if
> cookies are turned on? I suppose even if I do that, I should put a
> readonly lock around the links anyway, huh?

The Client scope doesn't need to be locked. You might consider copying
any
session data that you absolutely know you're going to need on each
page to
the Request scope; you can do this in application.cfm, and then you
don't
have to worry about sprinkling CFLOCKs throughout your pages - you'd
just
change the scope of the affected variables.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

----------------------------------------------------------------------
--------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_tal
k 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.

Reply via email to