I searched this forum for discussions about cflock
and read the livedocs at
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=sharedVars_20.html.
This reading is on top of me thinking I already knew
everything about using the cflock tag.
Apparently, I am not understanding a very critical
aspect of the cflock tag when locking the session scope.
My issue is regarding one user, one session, multiple
and concurrent requests arriving at the CF8 server
from the same user session.
Meaning, a web page that uses ajax, frames, pop-ups,
or the user hitting ctrl-n, will generate multiple
requests to the CF8 server using the same session.
Based on my understanding, using type="exclusive" will
effectively single-thread the access to code between
the lock tag. So my question is:
Why doesn't <cflock scope="session" type="exclusive" ...
>
single-thread the access to the code between the cflock
tag?
If you are kind enough to respond, I would really
appreciate an explanation why the current behavior
in CF8 is the more correct behavior. If the scope
is changed from session to application or server, it
will infact single-thread the access/execution.
So why is this not the case when the scope is session?
I arrived at this problem because I was trying
to explain to someone the difference between:
<cflock scope="session" type="exclusive" ... >
and
<cflock scope="session" type="readOnly" ... >
Based on my simple test and what I'm seeing, I discovered
I myself don't know the difference!
I know how to re-write the code to do exactly
what I want to do. I just can't seem to wrap
my head around why the cflock tag is implemented
this way (with respect to session and exclusivity).
However, it is more likely that I have a bug in my
simple test code...?
If you're interested, here's the code I used to
confirm/test my assumption:
Thank you for reading this post to the end!