Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

List of active sessions  RSS feed

 
hafedh zayani
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a web application where I save a row in database whenever an object is being edited by a user to prevent other users from editing the same object. Meaning that I lock the page if there is a user who is editing this object.
Example: user 'user1' is editing the object obj1 using the session session1.
In database I'll have:

USER SESSION OBJECT
user1 session1 object1


if the user log out, I remove the line from database. However, he can also close the navigator. So to unlock the object, I need to check (after a session timeout), that the session is nolonger active, and I delete it.

To do that I need to get the list of active sessions from the server. However I can't find any non deprecated method to do it.

Does anyone have an idea about this.
Thank you.

ZAYANI HAFEDH

http://www.zayani-hafedh.com
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Registering a HttpSessionListener in your deployment descriptor ?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not use a SessionBindingListener ? Your object can be notified when the user logs out or when the session times out. I think what you should be looking for is a transaction, so that no one else can touch the table that the user is working on.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!