Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP Session listener and session destroyed call

 
Monmohan Singh
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic