You guys have really lost and confused me on this thread. Why are you
locking session variables per user??? I would understand in the case of a
machine having a session with another machine but a session for a specific
user keeps other users out by design. And given that CF processes commands
in sequence you wouldn't have to worry about locking a session var unless
you are going to access it immediately and are concerned that your previous
write might not be finished in time. Locking variables is relatively new to
me, so I would like to understand them further, so if I'm completely missing
the ball park here, please let me know.
Also I believe that sessions are per application since you need an
application.cfm to initiate them. Yes or no? If yes then that would mean
that giving a session lock or a session variable the same name across
applications doesn't matter because they are essentially two different
variable... right?
awaiting clarification
Andrew Hewitt
> On 8/18/00, Dave Watts penned:
> >So, if you're locking session variables, and you're using 4.0.x so you
don't
> >have the SCOPE attribute, you want your lock to allow only one request to
> >change those variables at any one time. Since sessions are unique to
> >individual users, you'll want your lock name to be unique to individual
> >users as well. You don't want to lock ALL session variables with an
> >individual lock, just the session variables which belong to that user.
>
> Well, you lose me there. You say: "you'll want your lock name to be
> unique to individual users AS WELL". How do you make the lock unique
> to individual users AND lock out other users as well?
>
> It still seems to me that if the locks have names unique to the user,
> then someone else could be writing to that session variable as
> another user is accessing it. Or that several people could be writing
> to the same session variable at once. I thought that the whole idea
> behind locks was to stop multiple users from accessing the same
> session variable at once.
>
> Even in 4.51, If you use an exclusive lock with a scope of "Session",
> how does CF know which session variable access to lock? By the
> variable name? By a combination of the variable name and application
> name? Or does it stop all reads and writes to all session variables
> across the whole server?
>
> >
> >In the case of session variables, it shouldn't matter which application
> >they're in, as long as each lock is scoped in such a way as to make it
> >unique to that individual user.
>
> Same question. Same blank stare. LOL
>
> If a lock is named unique to a user, what stops another user from
> writing to it while it's being accessed or from two users writing to
> it at once?
>
> >
> > >
> >> 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.
> >
> >You're not really trying to lock an individual session variable; you're
> >trying to lock the Session scope. In any case, in the example above, the
> >second block of code won't execute until the first has completed anyway,
> >since a CF script is essentially a command batch.
>
> Well, that was my question. Which was basically: Does CF not care
> what's inside of the lock and only look at the name?
> --
>
> Bud Schneehagen - Tropical Web Creations
>
------------------------------------------------------------------------------
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.