Background Info: I am working on a project to lock a product id number so it may not be accessed by more than one session at a time. I create a lock by writing the session id, product id number, user id and timestamp to a oracle database table. What I am trying to do is release the lock when the user ends their session by closing a browser. Question: When a session is going to be invalidated because time out interval has been reached, is there a way to call a servlet to perform a "release lock" function? By the way, I am using Websphere 3.0.2 and Java 1.1.7
Jeff Satori
Greenhorn
Joined: Jun 06, 2001
Posts: 5
posted
0
OK, I figured out that I should use the HttpSessionBindListener.valueUnbound method but I am still unsure about the syntax which adds the listener to the the session. Could someone help me out with this?
Originally posted by Jeff Satori: OK, I figured out that I should use the HttpSessionBindListener.valueUnbound method but I am still unsure about the syntax which adds the listener to the the session. Could someone help me out with this?
req.getSession().setAttribute("bean", bean). Provided your bean implements HttpSessionBindingListener, it will be called automagically when it is unbound or the session expires. You might want to look into the DBMS_LOCK package, by the way. - Peter
Jeff Satori
Greenhorn
Joined: Jun 06, 2001
Posts: 5
posted
0
Thanks for your help Peter, that did the trick.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Notify servlet prior to session invalidate