3 Replies Latest reply on May 4, 2004 2:57 PM by Adrian Brock

    Connection pooling exception

    pigoor Newbie

      I am using jboss 3.2.3.
      I am trying to configure the parameters for connection pooling in my *-ds.xml file.

      <local-tx-datasource>
      <jndi-name>aqrProvDS</jndi-name>
      <connection-url>jdbc:oracle:thin:@127.0.0.1:1521:mydb</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>user</user-name>

      <min-pool-size>5</min-pool-size>
      <max-pool-size>10</max-pool-size>
      <blocking-timeout-millis>2000</blocking-timeout-millis>
      <idle-timeout-minutes>15</idle-timeout-minutes>
      <check-valid-connection-sql>"select count(*) from DUAL"</check-valid-connection-sql>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      </local-tx-datasource>

      When my application connects to the db, I get this exception

      WARN [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Destroying connection that is not valid, due to the following exception:
      java.sql.SQLException: ORA-00900: invalid SQL statement

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
      at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
      at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
      at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738)
      at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313)
      at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1353)
      at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1805)
      at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:575)
      at org.jboss.resource.adapter.jdbc.CheckValidConnectionSQL.isValidConnection(CheckValidConnectionSQL.java:30)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:459)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkValid(BaseWrapperManagedConnection.java:260)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.matchManagedConnections(LocalManagedConnectionFactory.java:182)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:175)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:496)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:425)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:318)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:477)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
      at aqr50.PETransactions.getPooledConnection(Unknown Source)
      at aqr50.PETransactions.getConnection(Unknown Source)
      at aqr50.PEUserTransactions.verifyUser(Unknown Source)
      at org.apache.jsp.processLogin_jsp._jspService(processLogin_jsp.java:87)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
      at java.lang.Thread.run(Thread.java:536)
      2004-05-04 11:46:47,340 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Destroying connection that could not be successfully matched: org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@182eca8

      I am able to connect to the database, but I also see these exceptions in the log. Could someone please tell me if I am doing something wrong ?

      Thanks,
      Preethi

        • 1. Re: Connection pooling exception
          Adrian Brock Master

          remove the " from the sql it is not a valid sql statement

          That is what the error message says:
          java.sql.SQLException: ORA-00900: invalid SQL statement

          • 2. Re: Connection pooling exception
            pigoor Newbie

            Thanks for your help !
            It worked.

            But now I see another exception, every so often:

            WARN [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover ignored unexpected runtime exception
            java.lang.ArrayIndexOutOfBoundsException: 10
            at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.removeTimedOut(InternalManagedConnectionPool.java:364)
            at org.jboss.resource.connectionmanager.IdleRemover$1.run(IdleRemover.java:70)
            at java.lang.Thread.run(Thread.java:536)


            My *-ds.xml looks like this:

            <local-tx-datasource>
            <jndi-name>aqrProvDS</jndi-name>
            <connection-url>jdbc:oracle:thin:@127.0.0.1:1521:mydb</connection-url>
            <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
            <user-name>user</user-name>
            test
            <min-pool-size>5</min-pool-size>
            <max-pool-size>10</max-pool-size>
            <blocking-timeout-millis>2000</blocking-timeout-millis>
            <idle-timeout-minutes>15</idle-timeout-minutes>
            <check-valid-connection-sql>select count(*) from DUAL</check-valid-connection-sql>
            <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
            </local-tx-datasource>


            Can you please help ?

            Thanks,
            Preethi

            • 3. Re: Connection pooling exception
              Adrian Brock Master

              If you made an effort to use search or help other people rather than just posting your own
              problems you would see there was a question about this last week, and the week
              before.