2 Replies Latest reply on Aug 27, 2010 2:22 AM by Doochul KIM

    DB Pooling isn't work with 'Too many open files' error.

    Doochul KIM Newbie

      Our service is stopped because db pooling isn't work.

      We review log and found that 'Too many open files' error is occured during connect to database.

       

      ------------------------------------------------------------------------------------------------------------------------------------------------------------------

      08/22/2010 03:09:42,077 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
      08/22/2010 03:09:42,078 ERROR [JDBCExceptionReporter] Could not create connection; - nested throwable: (com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

      ** BEGIN NESTED EXCEPTION **

       

      java.net.SocketException
      MESSAGE: java.net.SocketException: Too many open files

       

      STACKTRACE:

       

      java.net.SocketException: java.net.SocketException: Too many open files
          at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
          at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
          at com.mysql.jdbc.Connection.createNewIO(Connection.java:2541)
          at com.mysql.jdbc.Connection.<init>(Connection.java:1474)

      ....

      ------------------------------------------------------------------------------------------------------------------------------------------------------------------

       

      So we restart jboss quickly and service turned to be normal.

       

      We review log again and found some strange error message.

       

      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      08/07/2010 05:26:48,718 WARN  [LocalManagedConnectionFactory] Destroying connection that is not valid, due to the following exception:
      java.sql.SQLException: Ping failed: java.lang.reflect.InvocationTargetException
          at com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker.isValidConnection(MysqlValidConnectionChecker.java:77)
          at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:472)
      .......

      08/07/2010 05:26:48,720 WARN  [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1f58334[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@1cd9eab handles=0 lastUse=1281172607562 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@6c1995 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@103c504]
      java.sql.SQLException: Ping failed: java.lang.reflect.InvocationTargetException
          at com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker.isValidConnection(MysqlValidConnectionChecker.java:77)
          at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:472)
      .....

      08/07/2010 05:26:48,722 WARN  [JBossManagedConnectionPool] Destroying connection that could not be successfully matched: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1f58334[state=DESTROYED mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@1cd9eab handles=0 lastUse=1281172607562 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@6c1995 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@103c504]
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

       

      Above message is logged regually. ( Printed it per 10 mins )

      I think some connection could be invalid with any issues, but I couldn't understand why "destroying connection that could not be successfully matched" is logged and what does mean.

       

      What is meaning of above?

      and is it possible to concerned with 'Too many open files' error ?

       

      Our system consist with below component.

          Application Server : jBoss AS 4.0.2

          Database : MySQL 5.0.54

          ORM : hibernate

          JDBC Driver : mysql-connector-java-3.1.11-bin.jar

          DBPooling : DataSource ( configured to mysql-ds.xml on deploy folder of jbossAS )

       

      and below is config of connection pooling.

      <local-tx-datasource>
                      <jndi-name>jdbc/AAA</jndi-name>
              <connection-url>jdbc:mysql://<SERVERNAME>/<DBNAME></connection-url>
                      <driver-class>com.mysql.jdbc.Driver</driver-class>
              <user-name>{MYSQL-USERID}</user-name>
              <password>{MYSQL-PASSWORD}</password>
              <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
                      <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name>
              <min-pool-size>0</min-pool-size>
              <max-pool-size>150</max-pool-size>
              <blocking-timeout-millis>20000</blocking-timeout-millis>
            </local-tx-datasource>

       

      Thanks

      Ducheol