1 2 Previous Next 17 Replies Latest reply on May 19, 2003 8:47 AM by davidjencks

    serious problems with connection leaks in jboss 3.0.6

    marcin

      Hi,

      This is the case for real programmers :)

      I have quite complicated application which is migrated from jboss 2.4.6. Under heavy load the database connections are leaking. After an hour 100 connections can be aquired :(

      Software we tested on:
      JBoss 3.0.6, jdk1.4.1_02, JRockit 8, db: postgresql 7.2 or 7.3, jdbc drivers jdbc2, jdbc3

      Moreover the same application runs very well on JBoss3.2RC2 but still receiving two exceptions - which are pointing that something with connection management is not good.

      The same application runs very well on jboss 2.4.6. This is not the problem with closing connections in finally block!!! We have checked it several times and wrote special procedures that are checking if all opened connections in application are closed!

      Is there anyone who has the same problems? Maybe someone who wrote those pieces of code of the connection and transaction management can help?

      The stacktraces we are getting in JBoss3.2RC2:

      java.lang.IllegalStateException: Trying to return an unknown connection2! org.jboss.resource.adapter.jdbc.WrappedConnection@1c67
      at org.jboss.resource.connectionmanager.CachedConnectionManager.unregisterConnection(Lorg.jboss.resource.connectionmanager.ConnectionCacheListener;Ljava.lang.Object;)V(Cached
      at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.connectionClosed(Ljavax.resource.spi.ConnectionEvent;)V(TxConnectionManager.java:550)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.closeHandle(Lorg.jboss.resource.adapter.jdbc.WrappedConnection;)V(BaseWrapperManagedConnection.java:280)
      at org.jboss.resource.adapter.jdbc.WrappedConnection.close()V(WrappedConnection.java:97)
      at com._3dart.ejb.iau.types.IAUTypeManagerEJB.closeConnection()V(IAUTypeManagerEJB.java:228)
      at com._3dart.ejb.iau.types.IAUTypeManagerEJB.ejbCreate()V(IAUTypeManagerEJB.java:53)
      at COM.jrockit.reflect.NativeMethodInvoker.invoke0(ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Native Method)
      at COM.jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at COM.jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
      at org.jboss.ejb.StatelessSessionEnterpriseContext.(Ljava.lang.Object;Lorg.jboss.ejb.Container;)V(StatelessSessionEnterpriseContext.java:52)
      at org.jboss.ejb.plugins.StatelessSessionInstancePool.create(Ljava.lang.Object;)Lorg.jboss.ejb.EnterpriseContext;(StatelessSessionInstancePool.java:35)
      at org.jboss.ejb.plugins.AbstractInstancePool.get()Lorg.jboss.ejb.EnterpriseContext;(AbstractInstancePool.java:174)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(StatelessSessionInstanceInterceptor.java:63)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(Lorg.jboss.invocation.Invocation;Z)Ljava.lang.Object;(AbstractTxInterceptor.java:108)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(TxInterceptorCMT.java:243)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(TxInterceptorCMT.java:104)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(LogInterceptor.java:208)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(ProxyFactoryFinderInterceptor.java:154)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(StatelessSessionContainer.java:322)
      at org.jboss.ejb.Container.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(Container.java:652)
      at COM.jrockit.reflect.NativeMethodInvoker.invoke0(ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Native Method)
      at COM.jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at COM.jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(Ljava.lang.String;[Ljava.lang.Object;[Ljava.lang.String;)Ljava.lang.Object;(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(Ljavax.management.ObjectName;Ljava.lang.String;[Ljava.lang.Object;[Ljava.lang.String;)Ljava.lang.Object;(MBeanServerImpl.java:54
      at org.jboss.invocation.local.LocalInvoker.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(LocalInvoker.java:101)
      at org.jboss.invocation.InvokerInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(InvokerInterceptor.java:88)
      at org.jboss.proxy.TransactionInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(TransactionInterceptor.java:77)
      at org.jboss.proxy.SecurityInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(SecurityInterceptor.java:80)




      The second one, always a while after:

      java.lang.Exception: Stack Trace
      at org.jboss.resource.connectionmanager.CachedConnectionManager.closeAll(Ljava.util.Map;)V(CachedConnectionManager.java:357)
      at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObject(Ljava.util.Set;)V(CachedConnectionManager.java:199)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(CachedConnectionInterceptor.java:190)
      at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(EntityReentranceInterceptor.java:91)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(EntityInstanceInterceptor.java:174)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(EntityLockInterceptor.java:107)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(EntityCreationInterceptor.java:69)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(Lorg.jboss.invocation.Invocation;Z)Ljava.lang.Object;(AbstractTxInterceptor.java:108)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(TxInterceptorCMT.java:243)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(TxInterceptorCMT.java:104)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(LogInterceptor.java:208)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(ProxyFactoryFinderInterceptor.java:154)
      at org.jboss.ejb.EntityContainer.internalInvoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(EntityContainer.java:483)
      at org.jboss.ejb.Container.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(Container.java:652)
      at COM.jrockit.reflect.NativeMethodInvoker.invoke0(ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Native Method)
      at COM.jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at COM.jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(Ljava.lang.String;[Ljava.lang.Object;[Ljava.lang.String;)Ljava.lang.Object;(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(Ljavax.management.ObjectName;Ljava.lang.String;[Ljava.lang.Object;[Ljava.lang.String;)Ljava.lang.Object;(MBeanServerImpl.java:54
      at org.jboss.invocation.local.LocalInvoker.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(LocalInvoker.java:101)
      at org.jboss.invocation.InvokerInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(InvokerInterceptor.java:88)
      at org.jboss.proxy.TransactionInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(TransactionInterceptor.java:77)
      at org.jboss.proxy.SecurityInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(SecurityInterceptor.java:80)
      at org.jboss.proxy.ejb.EntityInterceptor.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(EntityInterceptor.java:112)
      at org.jboss.proxy.ClientContainer.invoke(Ljava.lang.Object;Ljava.lang.reflect.Method;[Ljava.lang.Object;)Ljava.lang.Object;(ClientContainer.java:82)
      at $Proxy209.getId()Ljava.lang.Long;(Unknown Source)
      at com._3dart.ejb.iau.misc.proxy.ProgramsProxy.connectPrograms(Ljava.util.Collection;Ljava.util.Hashtable;Lcom._3dart.ejb.iau.progs.IAUProgramHome;)V(ProgramsProxy.java:281)
      at com._3dart.ejb.iau.misc.proxy.ProgramsProxy.connectIdPrograms(Ljava.util.Collection;)V(ProgramsProxy.java:185)
      at com._3dart.ejb.iau.product.productcategory.ProductCategory.connectPrograms(Ljava.util.Date;Lcom._3dart.ejb.iau.misc.proxy.ProductsProxy;Lcom._3dart.ejb.iau.misc.proxy.Prog
      at com._3dart.ejb.iau.product.productcategory.ProductCategory.selectIdControls(Ljava.util.Collection;Lcom._3dart.ejb.iau.misc.proxy.ProductsProxy;Lcom._3dart.ejb.iau.misc.pro

        • 1. Re: serious problems with connection leaks in jboss 3.0.6
          davidjencks

          The second stack trace appears to be the trace trying to help you figure out where the unclosed connection was obtained. Isn't there a loud warning right before it?

          The first trace looks like it may indicate a problem. Is there any way you can turn your code into a simple standalone test that demonstrates the problem? Can you reproduce it with hsqldb? Without an example this will be very hard to track down. You can send code to me privately if necessary (but if you do please be clear about what can and cannot be turned into a jboss test case).

          Thanks
          david jencks

          • 2. Re: serious problems with connection leaks in jboss 3.0.6
            olivier_p

            We've experienced today a very similar issue with JBoss 3.0.6 and an Oracle XA datasource:
            under high load, some database calls fail, their connection/transaction being in a "funky" state
            (causing DB Errors like "Not in a transaction", or "Fetch out of sequence")

            Note that we got rid of this by synchronizing the part of the code that acquires connections from the XA pool across all the instances of the corresponding bean (in our case, a stateless session bean):

            synchronized(OurSessionBean.class) {
            connection = ourDataSource.getConnection();
            }

            (only synchronizing this code at the instance level isn't enough - and we noticed that under load there were several instances of our stateless session bean running)

            Could there be a thread-safety issue in Jboss's connection mgmt code ? Did anyone else have the same problem ?

            Thanks,
            Olivier.

            • 3. Re: serious problems with connection leaks in jboss 3.0.6
              davidjencks

              Don't use an xa datasource with jboss 3.0.6 or earlier (at least if you want me to consider looking at it). 3.0.7 (cvs) and 3.2RC3 (and jb4) have more reasonable xa datasource support. If the problem persists with these versions and you do not get any "closing connections for you" messages please repost.

              • 4. Re: serious problems with connection leaks in jboss 3.0.6
                pazu

                By the way, I'm seeing this on JBoss 3.2.0RC3 too, exactly the same exceptions. Here are them:[pre]java.lang.IllegalStateException: Trying to return an unknown connection2! org.jboss.resource.adapter.jdbc.WrappedConnection@ef2f9f
                at org.jboss.resource.connectionmanager.CachedConnectionManager.unregisterConnection(CachedConnectionManager.java:274)
                at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.connectionClosed(TxConnectionManager.java:551)
                at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.closeHandle(BaseWrapperManagedConnection.java:280)
                at org.jboss.resource.adapter.jdbc.WrappedConnection.close(WrappedConnection.java:127)
                at com.telebahiacelular.movistore.dao.DAOMoviOraAb.closeConnection(DAOMoviOraAb.java:137)
                ...[/pre]As you can see, the exception happens exactly when I try to close the connection. A bit later another stack trace appears:[pre]10:17:40,567 INFO [CachedConnectionManager] Successfully closed a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@ef2f9f
                java.lang.Exception: Stack Trace
                at org.jboss.resource.connectionmanager.CachedConnectionManager.closeAll(CachedConnectionManager.java:357)
                at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObject(CachedConnectionManager.java:199)
                at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:190)
                at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
                at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:108)
                at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
                at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
                at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
                at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
                at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:154)
                at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
                at org.jboss.ejb.Container.invoke(Container.java:652)
                at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
                at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:88)
                at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
                at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
                at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:109)
                at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:82)
                at $Proxy211.selecionarPorFiltro(Unknown Source)
                at com.telebahiacelular.movistore.web.taglib.ListaTipoAtendimentoTag.doStartTag(ListaTipoAtendimentoTag.java:42)
                ...[/pre]I can send you the whole or part of the source code for the application if you want to check the source code (can't publish it in the forums, but can send to you in private).

                Just for some info, here is the "selecionarPorFiltro" method the shows up in the stack trace:[pre] public Collection selecionarPorFiltro(PrioridadeTipoAtendFiltroModel pFiltro) throws FinderException
                {
                final Log log = LogUtil.getLog(PrioridadeTipoAtendDAOOra.class, "selecionarPorFiltro");

                log.debug("Selecionando por filtro: " + pFiltro);

                Connection conexao = null;
                PreparedStatement statement = null;
                ResultSet resultSet = null;
                String query = "";

                try
                {
                conexao = getConnection();
                query =
                "SELECT PRI.COD_PREFIXO_SENHA, " +
                " PRI.COD_PRIORIDADE, " +
                " PRI.COD_TIPO_ATENDIMENTO, " +
                " PRI.COD_LOJA, " +
                " PRI.COD_EMPRESA, " +
                " PRI.DES_PRIORIDADE_TIPO_ATEND, " +
                " PRI.COD_USUARIO, " +
                " PRI.DTC_ULTIMA_ALTERACAO, " +
                " PRI.NUM_BOTAO, " +
                " PRI.NUM_AMBIENTE, " +
                " EMPRESA.DES_EMPRESA, " +
                " LOJA.DES_LOJA, " +
                " TP.DES_TIPO_ATENDIMENTO, " +
                " PA.DES_PRIORIDADE " +
                " FROM EMPRESA EMPRESA, " +
                " PRIORIDADE_TIPO_ATENDIMENTO PRI, " +
                " LOJA LOJA, " +
                " TIPO_ATENDIMENTO TP, " +
                " PRIORIDADE_ATENDIMENTO PA " +
                " WHERE EMPRESA.COD_EMPRESA = PRI.COD_EMPRESA " +
                " AND PRI.COD_LOJA = LOJA.COD_LOJA " +
                " AND TP.COD_TIPO_ATENDIMENTO = PRI.COD_TIPO_ATENDIMENTO " +
                " AND PA.COD_PRIORIDADE = PRI.COD_PRIORIDADE" +
                " AND (PRI.COD_EMPRESA = ? OR ? IS NULL)" +
                " AND (PRI.COD_LOJA = ? OR ? IS NULL)";

                String acesso = getFiltroLoja("PRI", pFiltro.getCodUsuario(), pFiltro.getCodFiltroLoja());

                if (acesso != null && acesso.length() > 0)
                query += " AND " + acesso;
                log.debug("SQL: " + query);

                statement = conexao.prepareStatement(query);
                setString(statement, 1, 2, pFiltro.getCodEmpresa());
                setInteger(statement, 3, 4, pFiltro.getCodLoja());
                resultSet = statement.executeQuery();

                ArrayList listaRetorno = new ArrayList();

                while (resultSet.next())
                listaRetorno.add(criaAtendimentoDescModel(resultSet));

                return listaRetorno;
                }
                catch (java.sql.SQLException e)
                {
                log.error(e.getMessage(), e);
                throw new EJBException("Erro ao selecionar objetos", e);
                }
                finally
                {
                closeResult(resultSet);
                closeConnection(conexao, statement);
                }
                }
                [/pre]The closeResult() and closeConnection are utility methods that checks for null and then close the ResultSet/Statement/Connection:[pre] public void closeConnection(Connection connection, Statement statement)
                {
                closeStatement(statement);
                closeConnection(connection);
                }

                public void closeConnection(Connection connection)
                {
                try
                {
                if (connection != null)
                {
                connection.close();
                }
                }
                catch (SQLException e)
                {
                throw new EJBException(e);
                }
                }

                public void closeResult(ResultSet resultSet)
                {
                try
                {
                if (resultSet != null)
                {
                resultSet.close();
                }
                }
                catch (SQLException e)
                {
                throw new EJBException(e);
                }
                }

                public void closeStatement(Statement statement)
                {
                try
                {
                if (statement != null)
                {
                statement.close();
                }
                }
                catch (SQLException e)
                {
                throw new EJBException(e);
                }
                }[/pre]Ask for anything else you need to solve this problem. My environment: JBoss 3.2.0RC3 running on i386 RedHat Linux 7.3 (kernel 2.4.18), Blackdown J2SDK 1.4.1, Oracle 8i database with Oracle Thin JDBC drivers.

                • 5. Re: serious problems with connection leaks in jboss 3.0.6
                  pazu

                  Just to let you guys know: I've just downloaded JBoss-3.2.0RC4 and this problem is *still*there.

                  And I can swear: my code is not leaking connections. The stack trace above shows that JBoss throws an error just when I'm about to close the connection. So please, at least admit this is a JBoss bug. Knowledge of a problem is the first step to solve it :)

                  • 6. Re: serious problems with connection leaks in jboss 3.0.6
                    pazu

                    Just to let you guys know: I've just downloaded JBoss-3.2.0RC4 and this problem is *still*there.

                    And I can swear: my code is not leaking connections. The stack trace above shows that JBoss throws an error just when I'm about to close the connection. So please, at least admit this is a JBoss bug. Knowledge of a problem is the first step to solve it :)

                    • 7. Re: serious problems with connection leaks in jboss 3.0.6
                      pazu

                      No new info on this? I've tried every possible configuration and searched for leaked connections in the whole application.

                      I'm pretty sure that my application is not faulty for these leaking connections -- yet the problem persists. Any new scoop on this?

                      I'm running JBoss 3.2.0RC4 with an Oracle 8i database.

                      • 8. Re: serious problems with connection leaks in jboss 3.0.6

                        Getting something very similar with JBoss 3.0.7. Third party software that runs in 3.0.6 (no leaks, we tested that after all the headaches of "NoManagedConnections"), but not in 3.0.7:

                        java.lang.IllegalStateException: Trying to return an unknown connection2! org.jboss.resource.adapter
                        .jdbc.WrappedConnection@cf2994
                        at org.jboss.resource.connectionmanager.CachedConnectionManager.unregisterConnection(CachedC
                        onnectionManager.java:274)
                        at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListene
                        r.connectionClosed(LocalTxConnectionManager.java:371)
                        at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.closeHandle(BaseWrapperManag
                        edConnection.java:280)
                        at org.jboss.resource.adapter.jdbc.WrappedConnection.close(WrappedConnection.java:97)
                        at com.yasutech.qrules.ejb.DefaultAliasSetStorageHandler.closeConnectionAndPreparedStatement
                        (DefaultAliasSetStorageHandler.java:417)
                        at com.yasutech.qrules.ejb.DefaultAliasSetStorageHandler.getEntityIdForAliasSet(DefaultAlias
                        SetStorageHandler.java:384)
                        at com.yasutech.qrules.ejb.DefaultAliasSetStorageHandler.storeAliasSetFields(DefaultAliasSet
                        StorageHandler.java:308)
                        at com.yasutech.qrules.ejb.DefaultAliasSetStorageHandler.store(DefaultAliasSetStorageHandler
                        .java:339)
                        at com.yasutech.qrules.ejb.AliasSetBean.ejbStore(AliasSetBean.java:240)
                        at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                        • 9. Re: serious problems with connection leaks in jboss 3.0.6
                          davidjencks

                          This may be entirely bug 692398. This is fixed in 3.2 cvs (after RC4) and head. Unfortunately I did not get the fix committed to the 3.0 branch before 3.0.7 was released. I'm doing some tests before committing this and several other fixes to 3.0.

                          • 10. Re: serious problems with connection leaks in jboss 3.0.6
                            pazu

                            Nice to hear this, David -- I'll try to check out the code from CVS to see if this problem is solved. I'm not really interested in 3.0.x fixes, this post titles just reflect the worries of the first poster.

                            By the way, you're still using sf.net bug tracker? Quite limited IMHO.

                            • 11. Re: serious problems with connection leaks in jboss 3.0.6
                              pazu

                              The problem is fixed, Jencks. Thank you :)

                              • 12. Re: serious problems with connection leaks in jboss 3.0.6
                                sum1else

                                When will 3.0.8 be released? I think we are running into the problem that David fixed.

                                Can I get my hands on a version of the fixed code before the release of 3.0.8?

                                Thanks,
                                John H.

                                • 13. Re: serious problems with connection leaks in jboss 3.0.6
                                  rudifr

                                  I have the same problem with JBoss 3.0.7, 3.2.0 and 3.2.1. The database is Oracle 9.2.0.

                                  • 14. Re: serious problems with connection leaks in jboss 3.0.6
                                    rudifr

                                    It's not exactly the same problem. I get
                                    "java.lang.IllegalStateException: Trying to return an unknown connection1!" every time a connection is being returned.

                                    13:24:06,050 INFO [Server] JBoss (MX MicroKernel) [3.2.1 (build: CVSTag=JBoss_3_2_1 date=200305041533)] Started in 43s:581ms
                                    13:24:39,169 INFO [TxConnectionManager$TxConnectionEventListener] throwable from unregister connection
                                    java.lang.IllegalStateException: Trying to return an unknown connection1! org.jboss.resource.adapter.jdbc.WrappedConnection@a5f709
                                    at org.jboss.resource.connectionmanager.CachedConnectionManager.unregisterConnection(CachedConnectionManager.java:264)
                                    at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.connectionClosed(TxConnectionManager.java:550)
                                    at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.closeHandle(BaseWrapperManagedConnection.java:280)
                                    at org.jboss.resource.adapter.jdbc.WrappedConnection.close(WrappedConnection.java:127)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:324)
                                    at org.jboss.resource.connectionmanager.CachedConnectionManager.closeAll(CachedConnectionManager.java:375)
                                    at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObject(CachedConnectionManager.java:199)
                                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:190)
                                    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
                                    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                                    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
                                    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
                                    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
                                    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                                    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                                    at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
                                    at org.jboss.ejb.Container.invoke(Container.java:674)
                                    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:353)
                                    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
                                    at $Proxy37.addMachine(Unknown Source)
                                    at com.cortex_brainware.tryejb.datamaintenance.appserver.DatamaintenanceBean.addMachines(DatamaintenanceBean.java:53)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:324)
                                    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
                                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
                                    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
                                    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                                    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
                                    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
                                    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
                                    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                                    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                                    at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
                                    at org.jboss.ejb.Container.invoke(Container.java:674)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:324)
                                    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                                    at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:324)
                                    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
                                    at sun.rmi.transport.Transport$1.run(Transport.java:148)
                                    at java.security.AccessController.doPrivileged(Native Method)
                                    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
                                    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
                                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
                                    at java.lang.Thread.run(Thread.java:536)
                                    13:24:39,179 INFO [CachedConnectionManager] Successfully closed a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@a5f709
                                    java.lang.Exception: Stack Trace
                                    at org.jboss.resource.connectionmanager.CachedConnectionManager.closeAll(CachedConnectionManager.java:376)
                                    at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObject(CachedConnectionManager.java:199)
                                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:190)
                                    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
                                    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                                    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
                                    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
                                    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
                                    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                                    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                                    at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
                                    at org.jboss.ejb.Container.invoke(Container.java:674)
                                    at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:353)
                                    at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
                                    at $Proxy37.addMachine(Unknown Source)
                                    at com.cortex_brainware.tryejb.datamaintenance.appserver.DatamaintenanceBean.addMachines(DatamaintenanceBean.java:53)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:324)
                                    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
                                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
                                    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
                                    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                                    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
                                    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
                                    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
                                    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                                    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                                    at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
                                    at org.jboss.ejb.Container.invoke(Container.java:674)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:324)
                                    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                                    at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:324)
                                    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
                                    at sun.rmi.transport.Transport$1.run(Transport.java:148)
                                    at java.security.AccessController.doPrivileged(Native Method)
                                    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
                                    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
                                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
                                    at java.lang.Thread.run(Thread.java:536)

                                    It happens with JBoss 3.0.7, 3.2.0 and 3.2.1. The database is Oracle 9.2.0.
                                    The JDK version is 1.4.1_02 and 1.3.1_01.

                                    Any help would be appreciated.
                                    Thanks in advance.

                                    Rudi.

                                    1 2 Previous Next