Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-2888

Calling Session.invalidate() leads to an explosion of new sessions

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 2.0.1.GA, 2.0.2.CR1, 2.1.0.A1
    • Fix Version/s: 2.1.0.BETA1
    • Component/s: Core
    • Labels:
      None
    • Estimated Difficulty:
      Medium

      Description

      There appears to be a pretty nasty bug in Seam during the post-session invalidation routine. If you call #

      {session.invalidate}

      (which is also called by #

      {identity.logout}

      ) a new session is created each time the conversation is referenced for the duration of the request.

      To observe this behavior, install an HttpSessionListener that watches for session creation. Then run one of these two action listener methods. You will observe the many hits to the sessionCreated() method during the request that terminates the session with Session.invalidate().

      public class SessionNotifier implements HttpSessionListener {
      public void sessionCreated(HttpSessionEvent e)

      { System.out.println("created session with id: " + e.getSession().getId()); }

      public void sessionDestroyed(HttpSessionEvent e) {}
      }

      You can run Thread.dumpStack() in the listener to see that it is happening as a result of attribute reads on the ServerConversationContext. I guess because the session was invalidated, Seam attempts to recreate the session over and over as it works with the conversation within that request.

      I consider this a pretty serious bug because it leads to significant growth of the HTTP session.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  norman.richards Norman Richards
                  Reporter:
                  dan.j.allen Dan Allen
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 2 days
                    2d
                    Remaining:
                    Remaining Estimate - 2 days
                    2d
                    Logged:
                    Time Spent - Not Specified
                    Not Specified