Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-275

removeAbandoned parameter not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.2.2
    • 1.2.2
    • None
    • Windows XP,Tomcat 5.5.12,My SQL 5.0.68 Enterprise version,java 1.5

    Description

      Hi,

      Iam using tomcat connection pooling to maintain db connections.
      The following configurations were made in context.xml.

      <Resource name="jdbc/testdb" auth="Container"
      type="javax.sql.DataSource"
      username="root" password="root123"
      driverClassName="com.mysql.jdbc.Driver"
      url="jdbc:mysql://localhost:3306/test35_dev"
      maxActive="-1"
      maxIdle="10"
      minIdle="6"
      maxwait="5000"
      minEvictableIdleTimeMillis="30000"
      numTestsPerEvictionRun = "25"
      timeBetweenEvictionRunsMillis="30000"
      removeAbandoned="true"
      removeAbandonedTimeout="60"
      />

      I used the following code to look up and get the data base connections

      Context initCtx = new InitialContext();
      Context envCtx = (Context) initCtx.lookup("java:comp/env");
      // Look up our data source
      DataSource ds = (DataSource) envCtx.lookup("jdbc/testdb");
      // Allocate and use a connection from the pool
      Connection connection = ds.getConnection();

      After this the application is creating 50 connections and it is not closing
      the connections after using.Will removeAbandoned step in and return the
      connections to the pool and remove the excess connections greater than maxIdle
      parameter.But when the application needs the next set of connections it is
      creating new connections instead of using the existing ones and as a result the
      MySql server is running out of connections.Why is removeAbandoned not handling
      the unclosed connections even after 1 minute even though it is configured to do
      so.

      Please advise on the possible solutions.

      Thanks

      Attachments

        Activity

          People

            Unassigned Unassigned
            svkirans Venkata Kiran
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: