Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Session listener and session destroyed call  RSS feed

 
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: 13078
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!