6 Replies Latest reply on Sep 7, 2006 11:27 AM by ldevallonne

    OracleExceptionSorter and CLOSED CONNECTION exception

    ldevallonne

      Hello

      We are using JBoss 4.0.2 and Oracle 10 G on a AIX/HACMP cluster, while the DB is being move from a node to another, we (obviously) experiment database deconnections. During reconnection, JBoss OracleExceptionSorter catch all errors but one : CLOSED CONNECTION.

      We have subclassed the default Oracle exception sorter and added a trap for it, but I was wondering if it would make sens to add that back to JBoss source code ?

      Regards

      Luc

        • 1. Re: OracleExceptionSorter and CLOSED CONNECTION exception
          weston.price

          What version of JBoss are you using? There were singinficant improvements added to the OracleExceptionSorter in 4.0.5. I believe this one made it in.

          • 2. Re: OracleExceptionSorter and CLOSED CONNECTION exception
            ldevallonne

            Hello,

            We are using JBoss 4.0.2. I had a look to the OracleExceptionSorter of version 4.0.5CR1, but this particular error (code 17008) is not caught.

            Looking into it, it seems that that the TxConnectionManager returns a closed connection to the JMS layer (we use oracle persistency for JMS). The full exception looks like :

            2006-09-06 12:17:30,868 WARN [org.jboss.resource.connectionmanager.TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@18986e81[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@1d196e81 handles=0 lastUse=1157545050652 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1beeee9 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@46a4aee8]
            java.sql.SQLException: Closed Connection
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
            at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:1133)
            at org.jboss.resource.adapter.jdbc.local.LocalManagedConnection.rollback(LocalManagedConnection.java:119)
            at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource.rollback(TxConnectionManager.java:781)
            at org.jboss.tm.TransactionImpl$Resource.rollback(TransactionImpl.java:2166)
            at org.jboss.tm.TransactionImpl.rollbackResources(TransactionImpl.java:1728)
            at org.jboss.tm.TransactionImpl.rollback(TransactionImpl.java:384)
            at org.jboss.tm.TxManager.rollback(TxManager.java:323)
            at org.jboss.mq.sm.jdbc.JDBCStateManager$JDBCSession.close(JDBCStateManager.java:626)
            at org.jboss.mq.sm.jdbc.JDBCStateManager.checkLoggedOnClientId(JDBCStateManager.java:336)
            at org.jboss.mq.sm.AbstractStateManager.addLoggedOnClientId(AbstractStateManager.java:187)
            at org.jboss.mq.server.JMSDestinationManager.getID(JMSDestinationManager.java:207)
            at org.jboss.mq.server.JMSServerInterceptorSupport.getID(JMSServerInterceptorSupport.java:77)
            at org.jboss.mq.server.TracingInterceptor.getID(TracingInterceptor.java:71)
            at org.jboss.mq.server.JMSServerInvoker.getID(JMSServerInvoker.java:78)
            at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:135)
            at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:369)
            at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:377)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
            at java.lang.Thread.run(Thread.java:570)

            • 3. Re: OracleExceptionSorter and CLOSED CONNECTION exception
              weston.price

              What version of the Oracle Driver are you using? The patch that was applied to 4.0.5CR1 should catch the code, but it looks like it is not catching the appropriate text if you look at the line:

              if( ( error_code < 20000 || error_code >= 21000 ) &&
              ( (error_text.indexOf("SOCKET") > -1) //for control socket error
              || (error_text.indexOf("CONNECTION HAS ALREADY BEEN CLOSED") > -1)
              || (error_text.indexOf("BROKEN PIPE") > -1) ) )

              This is to allow user defined codes on the driver.

              In the interim, you can define your own ExceptionSorter to handle this case and I can incorporate the changes in a later release.

              • 4. Re: OracleExceptionSorter and CLOSED CONNECTION exception
                ldevallonne

                We use the ojdbc14.jar 10.2.0.1.0 from Oracle.

                The modification could look like :

                if( ( error_code < 20000 || error_code >= 21000 ) &&
                ( (error_text.indexOf("SOCKET") > -1) //for control socket error
                || (error_text.indexOf("CONNECTION HAS ALREADY BEEN CLOSED") > -1)
                || (error_text.indexOf("BROKEN PIPE") > -1)
                || (error_text.indexOf("CLOSED CONNECTION") > -1) ) ) //Oracle driver error 17008

                • 5. Re: OracleExceptionSorter and CLOSED CONNECTION exception
                  weston.price

                  Correct. Note, some of this stuff (ExceptionSorter/ValidationChecker) is being reworked but the concepts remain the same.

                  • 6. Re: OracleExceptionSorter and CLOSED CONNECTION exception
                    ldevallonne

                    Shall submit that change myself ?