[Design of Clustering on JBoss] - Re: Removing SFSB in HttpSessionListener
by tkimura@redhat.com
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#4175723
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175723
17 years, 7 months
[Design of EJB 3.0] - Re: EJB3 Classloader Leak (EJBTHREE-1442)
by bstansberry@jboss.com
>From a JBoss Profiler analysis of this:
!--org.jboss.classloader.spi.base.BaseClassLoader@166889468(BaseClassLoader@9f287fc{vfszip:/home/bes/dev/jboss/clean/trunk/testsuite/output/lib/classloader-leak-ejb3.jar})
| !--!--ClassLoaderReference @ java.lang.Class@161343925(interface org.jboss.test.classloader.leak.ejb3.Ejb3StatelessSession)
| !--!--!--ReferenceInterface@java.lang.Class(a)370564132(class $Proxy177)
| !--!--!--!--arrayRef [Ljava.lang.Object;[0] id=@1684924387
| !--!--!--!--!--FieldReference protected java.lang.Object[] java.util.Vector.elementData=java.util.Vector@1804802967([class $Proxy177, class $Proxy178])
| !--!--!--!--!--!--FieldReference private java.util.Vector java.lang.ClassLoader.classes=org.jboss.classloader.spi.base.BaseClassLoader@1648466027(BaseClassLoader@6241986b{vfsfile:/home/bes/dev/jboss/clean/trunk/build/output/jboss-5.0.0.CR2/server/all/deploy/ejb3-connectors-jboss-beans.xml})
| !--!--!--!--!--!--!--FieldReference private java.lang.ClassLoader org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule.classLoader=org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule@116952494(VFSDeploymentClassLoaderPolicyModule ejb3-connectors-jboss-beans.xml:0.0.0)
... carries on into the default classloading domain.
Looks like a proxy class loaded by the ejb3-connectors-jboss-beans.xml classloader is holding a ref to the org.jboss.test.classloader.leak.ejb3.Ejb3StatelessSession loaded from the ejb deployment. I think this is a manifestation of the problem in SessionProxyFactoryBase discussed at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=141165. I bet if you limit the creation of an alternative proxy to cases where the caller classloader's version of the business interface is distinct from the standard one, this leak will go away.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175721#4175721
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175721
17 years, 7 months