This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See 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.
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.