do you have to use application.cfm to use session variables?

jake
----- Original Message -----
From: "Bud" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 18, 2000 9:00 AM
Subject: RE: CFLOCK and server variables


> On 7/13/00, Dave Watts penned:
> >  > The also recommend <name="#session.sessionid#"> when locking
> >>  session vars; do you agree, or if not, what do you recommend?
> >
> >No, again, this causes the same problem. You want a unique name to apply
to
> >an individual session, but you don't want to store it in a session
variable.
> >If you're using CF's cookies for state management, you could do this:
> >
> ><cflock name="#Cookie.CFID##Cookie.CFTOKEN#" ....>
>
> OK. I'm still having a hard time getting a grasp on this (so, what
> else is new?).
>
> I thought the whole idea of naming a lock was so nobody else would be
> able to read or write to that memory space and it would lock other
> users out based on the name of the lock.
>
> So, if I'm setting a session variable named "total":
>
> <cfset session.total = session.subtotal + tax>
>
> If I lock that cfset and name the lock #Cookie.CFID##Cookie.CFTOKEN#,
> won't that mean that anyone else would still be able to write to
> session.total and session.subtotal seeing as how using that method
> everyone would have the same lock named differently? I mean, why name
> a lock if every user has the lock named differently? Won't ColdFusion
> look and see if a lock by that name is being written and if it's not,
> go ahead and write it?
>
> And a question about names across different application, or even the
> same application, but named differently:
>
> When accessing or writing an application or session variable, does
> the danger lie only within duplicate named variables within the same
> application? Or across the whole server? Example:
>
> I have 3 instances of my shopping cart on a server which uses the
> session variable "session.total", all 3 with the application name
> unique (I always name the application the same name as the main
> datasource of the app so there's no chance I can accidentally name 2
> applications the same). Joe Blow has his totally different shopping
> cart and it also uses a session variable of "session.total".
>
> If none of these were locked, and there is a single user using each
> shopping cart, and each cart has a diffent application name, and they
> are all writing a session.total at the exact same time, is there a
> danger in that? Or would there only be a danger if 2 people were
> writing to session.total in the SAME NAMED APPLICATION at the same
> time?
>
> If it's based upon the session variable name across the server and
> not within an application, then there's no way of knowing that you
> could ever have a uniquely named lock. I am HOPING it's based on the
> name in cfapplication.
>
> And one more question:
>
> If you are locking all session variables with the same name by using
> a unique local variable, will that cause all writing to all sessions
> to be postponed until the lock is released?
>
> For instance, I have these 2 cfsets:
>
> <cflock name="#variables.mylock#  type="Exclusive" timeout="10">
> <cfset session.total = session.subtotal + tax>
> </cflock>
>
> <cflock name="#variables.mylock#  type="Exclusive" timeout="10">
> <cfset session.user_id = somequery.user_id>
> </cflock>
>
> Would the second query be locked out while the first is being written
> since the locks are named the same (even though they are accessing
> different session variables)? If so, then it seems like it would be
> detrimental to name any 2 locks the same that don't contain
> references to the same session variable. I'm assuming this is the
> case.
>
> I'm hoping this will clear things up for me once and for all. I read
> BF's CFLOCK article in CFDJ and although it was a little useful,
> there was really no clear cut explanation about what happens across
> different applications on the server. Sadly, that is what the
> majority of us are faced with. I have alot of copies of the same
> application running on my server and if I need to lock session.total
> with the same name on all instances of the application to stop all
> users from writing to session.total no matter what application it is
> in, then that's REALLY going to be a performance hit. If I can at
> least name the lock different on each copy of the application, and
> not worry about a user writing to session.total on application A
> while other users are writing to session.total on applications B, C,
> D, and E, that would be somewhat helpful.
>
> I hope somebody understood that. LOL
> --
>
> Bud Schneehagen - Tropical Web Creations
>
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> ColdFusion Solutions / eCommerce Development
> [EMAIL PROTECTED]
> http://www.twcreations.com/
> 954.721.3452
> --------------------------------------------------------------------------
----
> 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.

Reply via email to