commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cindy Ballreich <ci...@ballreich.net>
Subject RE: [DBCP] Maintaining a minimum number of connections
Date Thu, 10 Apr 2003 18:50:55 GMT
Vikas,

Thanks for responding!

Yes, I'm using MaxIdle, but it only controls the maximum number of connections that can be
idle. I'm concerned about the *minimum* number of connections. I've also set minEvictableIdleTimeMillis
to -1 which "should" cause connections never to time out (if I understand it's use correctly).
So it would seem that minEvictableIdleTimeMillis set not to time out, and MaxIdle set to keep
the number of idle connections to a reasonable number (say 10), I should always be able to
have at least 10 connections even if they're idle. This does not seem to be happening. The
connections were all closed when I tested them this morning. 

Perhaps this is a moot issue since the production server will probably have enough accesses
to keep the connections from timing out, but I'm concerned that I can't keep these (idle)
connections open on my test server.

Any other thoughts would be most welcome.

Cindy

ps. here's the Resource entry from server.xml in case that offers some clues...

          <Resource name="jdbc/Support" auth="Container" type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/Support">
            <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>myUser</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>myPassword</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>org.gjt.mm.mysql.Driver</value>
            </parameter>
            <parameter>
              <name>url</name>
              <value>jdbc:mysql://localhost/myDatabase</value>
            </parameter>
            <parameter>
              <name>minEvictableIdleTimeMillis</name>
              <value>-1</value>
            </parameter>
            <parameter>
              <name>maxActive</name>
              <value>100</value>
            </parameter>
            <parameter>
              <name>maxIdle</name>
              <value>10</value>
            </parameter>
            <parameter>
              <name>maxWait</name>
              <value>10000</value>
            </parameter>
            <parameter>
              <name>removeAbandoned</name>
              <value>true</value>
            </parameter>
            <parameter>
              <name>removeAbandonedTimeout</name>
              <value>5</value>
            </parameter>
            <parameter>
              <name>logAbandoned</name>
              <value>true</value>
            </parameter>
            <parameter>
              <name>validationQuery</name>
              <value>SELECT 1;</value>
            </parameter>
            <parameter>
              <name>AutoReconnect</name>
              <value>true</value>
            </parameter>
          </ResourceParams>


Mime
View raw message