aspose file tools*
The moose likes Servlets and the fly likes Running code when session killed by Hot Deployment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Running code when session killed by Hot Deployment" Watch "Running code when session killed by Hot Deployment" New topic
Author

Running code when session killed by Hot Deployment

Steve Leach
Ranch Hand

Joined: Sep 24, 2003
Posts: 46
Hi all
I am using Tomcat 4's Hot Deployment functionality to develop my application, and it seems to kill whatever sessions are currently active. I can live with that, and it seems the safest thing to do, but there is one problem.
When a session ends (for whatever reason) I have to perform some cleanup actions in the database. To achieve this I add a "SessionMonitor" object to the session which implements HttpSessionBindingListener. I can then do my cleanup in the SessionMonitor.valueUnbound() method.
However, when the session is ended by a Hot Deployment the valueUnbound() method doesn't seem to be called, and so my database cleanup doesn't get done.
Is this a bug in Tomcat ?
Cheers
Steve
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12805
    
    5
What sequence of management commands are you using? I would expect that there should be some way to make it invalidate the existing sessions.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running code when session killed by Hot Deployment