1 Reply Latest reply on Jun 22, 2011 1:25 PM by mp911de

    Disable connection tracking in JBoss 5.1

    ejb3workshop

      I have a rather complex application which manages it's own transaction. However JBoss determines that I didn't close my connection properly and does it for me.

      21:00:00,088 INFO  [CachedConnectionManager] Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@1a94871e

      java.lang.Throwable: STACKTRACE

              at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:278)

              at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:524)

              at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)

              at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)      

       

      I am 100% certain that if JBoss would not interfere the application would manage the connection disposal correctly. In JBoss 4.2.3 I managed to disable this by following : http://community.jboss.org/wiki/WhatDoesTheMessageDoYourOwnHousekeepingMean. I tried doing the same by changing

      jca-jboss-beans.xml in JBoss 5.1 however this did not seem to fix the problem.

       

      Any suggestion on how I can tell JBoss not to interfere my the database connections?

       

      Thanks in advance.

        • 1. Re: Disable connection tracking in JBoss 5.1
          mp911de

          Hi Alexander,

          you need to look in five places:

           

          1. deploy/jbossweb.sar/server.xml: remove org.jboss.web.tomcat.service.jca.CachedConnectionValve (default at the end of the file)
          2. deploy/jbossweb.sar/META-INF/jboss-beans.xml: remove <depends>jboss.jca:service=CachedConnectionManager</depends>
          3. deploy/ejb3-interceptors-aop.xml: remove <interceptor factory="org.jboss.ejb3.connectionmanager.CachedConnectionInterceptorFactory" scope="PER_CLASS"/> and <interceptor-ref name="org.jboss.ejb3.connectionmanager.CachedConnectionInterceptorFactory"/>
          4. deployers/ejb-deployer-jboss-beans.xml: remove <property name="cachedConnectionManagerName">jboss.jca:service=CachedConnectionManager</property>
          5. conf/standardjboss.xml: remove all <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>

           

           

          If you want, you could also remove CachedConnectionManager in deploy/jca-jboss-beans.xml, but i'm not sure, what other services rely on this service. The notification is always a hint, that you move away from standard behavior....

           

          Best regards,

          Mark