SoftTeam Lemaire Arnauld wrote:

>  Hi everybody,in my application, i create temporary table on a
> database for each session . When the session stop, i want to kill the
> table .How can i detect the end of a session ?
> http://www.softsolutions.fr

You will need to bone up on the Servlet API a little bit to solve this
issue.

If you store a bean in the session that implements
HttpSessionBindingListener, then the valueUnbound() method of that
object will be called when the object is removed -- which will happen
automatically when the session is invalidated or it times out.  Thus,
you can define an object that listens for this message, and then deletes
the temporary table.

Be aware that if the server crashes instead of shutting down cleanly,
all the active session info will be lost, and you will have leftover
temporary tables.  You might want to arrange your application-startup
processing to clean out any leftovers.

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to