Thanx David all cleared up!!!
-----Original Message-----
From: Maddison, David [mailto:[EMAIL PROTECTED]]
Sent: 03 April 2001 13:35
To: Fusebox
Subject: RE: how does cfserver know when the session has timed out?
Mmmm, not quite sure what the question is, I think your confusing two
seperate things. I don't know the internals of CFSERVER so don't shoot me,
but every time a session is accessed, I guess cfserver puts a 'last
accessed' time stamp on it. I expect CFSERVER has a thread that
automatically cycles through all the sessions, and deletes any that have
timedout, that is any that were accessed more than the timeout, (setting in
CF Admin), minutes ago.
CFLOCK on the other hand is a different thing. CFLOCK handles concurrent
access to a shared resource. When CFSERVER encounters a CFLOCK, it checks
to see if there are any other threads currently accessing the piece of code
wrapped in the CFLOCK. If there isn't, the template executes as normal. If
there is, then the thread will wait for the 'TimeOut', (set in milli
seconds, so 30 is 30 miliseconds, and 30000 is 30 seconds), amount of time.
If it hasn't gained access to the code by then, it will throw an exception.
The rules are bent slightly when a type is included. If the code is locked
with READONLY, and READONLY access is require to the code, both threads can
enter the protected code. However only one thread can access code marked as
EXCLUSIVE. Check out page 122 of ColdFusion 4.5 CFML Language Reference.
BTW, your code:
>> <cfif isdefined("session.securityLevel")>
>> <cflock scope="session" timeout="30" type="readonly">
>> <cfset request.securityLevel = session.securityLevel>
The following CFIF statement is irrelevant since the code will not have run
if session.securitylevel hasn't been defined.
>> <cfif isdefined("session.securityLevel")>
>> <cfset request.customerID =
session.customerID>
>> </cfif>
>> </cflock>
>> <cfelse>
>> <cfset request.securityLevel = 0>
>> </cfif>
hope this helps :-)
<< David Maddison >>
wildfusion
W: http://www.wildfusion.com
E: [EMAIL PROTECTED]
M: +44 (7747) 024455
YahooIM: maddisondavid
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists