I don't know that this is a situation where you need to lock. Are you experiencing race conditions? I would try it without the locks and see if that makes a difference.
Also in this code: > <cflock name='numSessionsLk' timeout='15' type='exclusive'> > <cfset AppScope.numSessions = AppScope.numSessions + 1> > </cflock> If that is in onSessionEnd, and you are counting active sessions, shouldn't it be *minus* 1 rather than plus 1? Maybe I'm not clear on what you're going for. -- Josh ----- Original Message ----- From: "Julio Cesar Lima" <[EMAIL PROTECTED]> To: "CF-Talk" <[email protected]> Sent: Friday, April 20, 2007 7:16 AM Subject: OnSessionEnd runnning TWICE > Hi guys, > > I'm trying to count the number of sessions, and I'm getting crazy with > this. > > I have the following code on my onApplicationStart: > > <cflock name='numSessionsLk' timeout='15' type='exclusive'> > <cfset Application.numSessions = 0> > </cflock> > then I have this on my OnSessionStart: > > <cflock name='numSessionsLk' timeout='15' type='exclusive'> > <cfset Application.numSessions = Application.numSessions + 1> > </cflock> > > and finally I have this on my onSessionEnd: > > <!--- AppScope being my second arguments passed ---> > <cflock name='numSessionsLk' timeout='15' type='exclusive'> > <cfset AppScope.numSessions = AppScope.numSessions + 1> > </cflock> > > The onSessionEnd is executed twice. SO if I have numSessions = 4, if one > sessions expires, instead I have 3, I will have 2. :(. I place a cflog, > and logs twice. There are not cflocks nested on anything like it. > > I hope you guys can help me.... > > Thank you.... > > JC > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275945 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

