Hi Dragomir,

When the session is invalidated, the session must unbind all the attributes - so if 
you've registered an attribute as
a HttpSessionBindingListener it should get the notification.

Check out the javadoc:

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpSession.html#invalidate()

So, in short the answer is yes and you get the hook in to clean up on a session 
timeout.

- Danny

>
> An object that I store in my session has a persistent copy in
> my database. Depending on object's state, the persistent
> copy has to be removed from the database when the object
> is removed from the session.
>
> From the API I understand that the object has to
> implement HttpSessionBindingListener and valueUnbound method
> that does clean-up.
>
> What I am not sure if this method is executed when
> sesion expires and the servlet engine destroys the session..
> In other words, the user does not complete the procedure, and the object
> stays stored in the session until the session expires.
> Will my valueUnbound be exexuted?


Danny Coward
Servlet Specification & Web Java
Java Software Group, Sun Microsystems
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to