There are 3 scenarios the sessionDestroyed() method is called:
* Application is undeployed
This is the problem. We need to keep SFSBs here.
However, if the application holds local resources like FileInputStream/FileOutputStream
within non-SFSB Seam component and relies on the @Destroy method for releasing those
resources, it could be leak. If it's implemented within SFSBs, it would be released
when SFSBs get timed out.
* Sesssion timeout
Typically the SFSBs timeout and conversations timeout are lower than session timeout, so
it would be cleaned up before session timeout. So SFSBs are already destroyed.
* Application calls session.invalidate()
Need to clean up entire session, including conversations and SFSBs.
So this customized SeamListener would help:
| import javax.servlet.http.HttpSessionEvent;
| import org.jboss.seam.servlet.SeamListener;
|
| public class ClusteredJBossSeamListener extends SeamListener {
| public void sessionDestroyed(HttpSessionEvent event) {
| String threadName = Thread.currentThread().getName();
| // Those are application threads, the application calls the
session.invalidate() explicitly
| if (threadName.startsWith("http-") ||
| threadName.startsWith("ajp-")) {
| super.sessionDestroyed(event);
| } else {
| // Don't call ServletLifecycle.endSession(event.getSession()) method,
it removes session contents and kills fail over capability
| }
| }
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175723#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...