Announcement Announcement Module
Collapse
No announcement yet.
Session Timeout Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Session Timeout

    Have created a mvc app (spring 2.5.5, s2ap rc1) using a session scoped bean to hold messaging network providers.

    I have implemented a:
    @PostConstruct
    public void postConstruct(){

    as well as a
    @PreDestroy
    public void preDestroy(){

    to setup and destroy messaging-network-connections (e.g. connection to gtalk) accordingly.

    The session is properly filled and maintained as long as the session is active.

    The session-object however frequently stays alive when the frontend-session is timed out.
    The @PreDestroy method is rarely called.

    The behavior is for me very easily traceable. As the sessionObject holds a connection to the gtalk messaging network, a valid session is reflected by the appropriate user being online.

    Even redeploying the application does not automatically destroy the session.

    What I am looking for is a hint how to hunt down the problem.

    From my point of view a timed out session in the browser / tomcat should automatically lead to a removement of the session-object (which implies the removement of the gtalk connection).

    Anx idea ??

    thanks in advance

  • #2
    @PostContruct/@PreDestroy are only hints for the ApplicationContext, so they aren't called when the session is destroyed. After creating the object isn't under control of the spring container any more.

    You probably need to write a session listener that acts upon the destruction of the session. Scan the objects see if they can be destroyed. You might want to create a JIRA for this I can see this as a valuable addition.

    Even redeploying the application does not automatically destroy the session.
    Tomcat by default serializes the active sessions to disk and restoring them at startup.

    Comment

    Working...
    X