my dog learned polymorphism*
The moose likes Java in General and the fly likes How to get intimated and catch user sessions when tomcat goes down using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to get intimated and catch user sessions when tomcat goes down using struts" Watch "How to get intimated and catch user sessions when tomcat goes down using struts" New topic
Author

How to get intimated and catch user sessions when tomcat goes down using struts

san jan
Greenhorn

Joined: Sep 26, 2000
Posts: 24
How to get intimated and catch user sessions when tomcat goes down using struts?How to invalidate sessions when Tomcat goes down?
Am using struts. Am using sockets in our application. And session ids are getting saved across tomcat restarts. So sockets are not getting cleaned properly when the server goes down since the session is not getting expired/invalidated.
Thanks,
Santosh
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Santosh,
Your display name does not comply with our naming policy so I'll have to ask you to change it.
Thanks.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Sorry, but "santu j" is still not a valid display name. Initials are only valid for first names, not last names. It's a picky rule, but it's one that we enforce strongly.
Dave
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I'm not sure I understand the question (I fail to see where sockets come into the picture), but you should be able to provide a solution using tokens.
I haven't done enough Struts work, but doesn't it have built-in support for tokens to prevent users submitting the same form twice? Although the sesison ID remains the same, the session data is lost between restarts and therefore the token check would fail.
Just an idea.
Dave
san jan
Greenhorn

Joined: Sep 26, 2000
Posts: 24
Probably the way I questioned was wrong.
I am using sockets and they are cleaned up by a method that gets called when a session is found to be invalid. But with tomcat even after restart the session is not becoming invalid (as cookies are used and the server was started before session timeout), but the socket is dangling since the application was closed and restarted.
So I wanted to get intimated before the server goes down so that I can clean the sockets.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

This thread is a duplicate and will be closed.
People wanting to help should see the this thread.
Dave
 
Consider Paul's rocket mass heater.
 
subject: How to get intimated and catch user sessions when tomcat goes down using struts
 
Similar Threads
How to get intimated and catch user sessions when tomcat goes down using struts?
multi-user applications
Session persistance over 2 JVMs
session alive after tomcat restarted
How to get intimated and catch user sessions when tomcat goes down using struts?