Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-5778

Improve HttpSessionListener handling in clustered environment

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • JBossAS-5.0.0.GA
    • JBossAS-4.2.0.GA, JBossAS-4.2.1.GA, JBossAS-4.2.2.GA, JBossAS-4.2.3.GA
    • Clustering
    • None

      Suppose we have a web application which uses stateful session beans, and we have a HttpSessionListener like this:

      public void sessionDestroyed(HttpSessionEvent event) {
      event.getSession().getAttribute("sfsb").remove(); // Make sure to call SFSB's @Remove method
      }

      This behavior is what Seam does.

      The HttpSessionListener.sessionDestroyed() would be called in session invalidation, session timeout and during undeploy/shutdown for cleaning up local resources. This happens in both cases, clustered and non-clustered .

      However, in clustered environment, the sfsb.remove() method call in HttpSessionListener becomes a cluster-wide operation. So when we shutdown one node, HttpSession is still available on the other node for fail over but SFSB is missing. As a result we will get javax.ejb.NoSuchEJBException: Could not find stateful bean.

              bstansbe@redhat.com Brian Stansberry
              rhn-support-tkimura Takayoshi Kimura
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: