Hi Dov,

I think the CFLOOP via COLLECTION is similar to what you propose with the LIST -- at least that's what the documentation tells me.

The number of threads on my machine usually hovers around 54.  Just now, it jumped to 96!  I took the CFLOOP out, and now it's back to 54.  So I still need to find a solution to this problem.

I like what you propose -- I'll give it a shot -- but meanwhile, I'm still confused about why my scheduled tasks to clean up the "dead" users doesn't work...

- Sung

>I'm not sure how java internals of cfloop/collection work, but chances
>are it's dangerous to loop through a collection you are deleting/adding
>items to/from.
>
>Perhaps change to CFLOOP list=StructKeyList(application.UsersInof)  and
>then retreive the item if it's there...  
>
>Also, How do you keep the person "online"... it seems like the following
>undesirable timeline is possible:
>
>8:00 User logs in, gets a now() timestamp
>8:14 User hits a page.  Since still has a timestamp, nothing happens
>8:16 User is deleted, since the 8:00 stamp expired, even though user hit
>2 minutes ago...
>
>You should update a user's timestamp on each hit... I'd write it like
>this:
>
>when user logs in,
><Cfset Session.Stamp=structnew()>
><Cfset session.stamp.last=now()>
><Cfset application.UsersInfo[session.userid]=session.stamp>
>
>Then whenever a user hits the page, you have
><Cfif session.isloggedin and isdefined("Session.stamp.last")>
><Cfset session.stamp.last=now()>
></cfif>
>
>Since session.stamp is a reference to a struct, which also exists in
>application.usersinfo, it doesnt get destroyed with the session....
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to