File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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: 12803
    
    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
 
jQuery in Action, 2nd edition
 
subject: HTTP Session listener and session destroyed call