This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes HTTP Session listener and session destroyed call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP Session listener and session destroyed call" Watch "HTTP Session listener and session destroyed call" New topic
Author

HTTP Session listener and session destroyed call

Monmohan Singh
Ranch Hand

Joined: Aug 02, 2002
Posts: 82
we need to implement an edit lock on some of our records so that they can't be simultaneously edited by two users.
Also we need to clean up the lock when the user time out happens.
We thought of implementing this using an HTTPSessionListener but the servlet 2.3 API suggests that the sessionDestroyed() is called after the session is destroyed. Then we have no way to decide what and which user to cleanup??
Looks like writing our own deamon thread is only possibility
Any thoughts on this will be helpful
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
You might be better off having an object in the session that holds the record information AND implements HttpSessionBindingListener. That way you are guaranteed that the object will get a valueUnbound call when the session is destroyed.
Bill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HTTP Session listener and session destroyed call
 
Similar Threads
Detection of session timeout
HTTP Session listener and session destroyed call
Form Bean - Session Scope
session management -session not destroying automatically
Reduce number of spring bean