• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running code when session killed by Hot Deployment

 
Steve Leach
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic