Complete rename of maxActive to maxTotal
authorMark Thomas <markt@apache.org>
Mon, 17 Feb 2014 13:33:43 +0000 (13:33 +0000)
committerMark Thomas <markt@apache.org>
Mon, 17 Feb 2014 13:33:43 +0000 (13:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/dbcp/trunk@1568985 13f79535-47bb-0310-9956-ffa450edef68

doc/abandon.jsp
src/main/java/org/apache/commons/dbcp2/BasicDataSource.java
src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
src/main/java/org/apache/commons/dbcp2/datasources/package.html
src/site/xdoc/configuration.xml
src/site/xdoc/guide/jndi-howto.xml
src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
src/test/java/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java

index f6fb78b..1886217 100644 (file)
@@ -38,7 +38,7 @@
       <parameter><name>removeAbandonedTimeout</name><value>0</value></parameter>
       <parameter><name>logAbandoned</name><value>true</value></parameter>
 
-      <parameter><name>maxActive</name><value>1</value></parameter>
+      <parameter><name>maxTotal</name><value>1</value></parameter>
     </ResourceParams>
 -->
 
index 3f9beae..5b4d2d9 100644 (file)
@@ -1617,7 +1617,7 @@ public class BasicDataSource
      * <li>{@link #getRemoveAbandonedOnBorrow()} or
      *     {@link #getRemoveAbandonedOnMaintenance()} = true</li>
      * <li>{@link #getNumIdle() numIdle} &lt; 2</li>
-     * <li>{@link #getNumActive() numActive} &gt; {@link #getMaxTotal() maxActive} - 3</li>
+     * <li>{@link #getNumActive() numActive} &gt; {@link #getMaxTotal() maxTotal} - 3</li>
      * </ul></code></p>
      *
      * <p>The default value is 300 seconds.</p>
index 4076dcf..5b71f59 100644 (file)
@@ -58,7 +58,7 @@ public class BasicDataSourceFactory implements ObjectFactory {
     private final static String PROP_CACHESTATE ="cacheState";
     private final static String PROP_DRIVERCLASSNAME = "driverClassName";
     private final static String PROP_LIFO = "lifo";
-    private final static String PROP_MAXACTIVE = "maxActive";
+    private final static String PROP_MAXTOTAL = "maxTotal";
     private final static String PROP_MAXIDLE = "maxIdle";
     private final static String PROP_MINIDLE = "minIdle";
     private final static String PROP_INITIALSIZE = "initialSize";
@@ -105,7 +105,7 @@ public class BasicDataSourceFactory implements ObjectFactory {
         PROP_CACHESTATE,
         PROP_DRIVERCLASSNAME,
         PROP_LIFO,
-        PROP_MAXACTIVE,
+        PROP_MAXTOTAL,
         PROP_MAXIDLE,
         PROP_MINIDLE,
         PROP_INITIALSIZE,
@@ -254,7 +254,7 @@ public class BasicDataSourceFactory implements ObjectFactory {
             dataSource.setLifo(Boolean.valueOf(value).booleanValue());
         }
 
-        value = properties.getProperty(PROP_MAXACTIVE);
+        value = properties.getProperty(PROP_MAXTOTAL);
         if (value != null) {
             dataSource.setMaxTotal(Integer.parseInt(value));
         }
index d9ed7a4..b5cf461 100644 (file)
@@ -49,7 +49,7 @@ webapp:
       &lt;name&gt;dataSourceName&lt;/name&gt;&lt;value&gt;java:comp/env/jdbc/bookstoreCPDS&lt;/value&gt;
     &lt;/parameter&gt;
     &lt;parameter&gt;
-      &lt;name&gt;defaultMaxActive&lt;/name&gt;&lt;value&gt;30&lt;/value&gt;
+      &lt;name&gt;defaultMaxTotal&lt;/name&gt;&lt;value&gt;30&lt;/value&gt;
     &lt;/parameter&gt;
 
   &lt;/ResourceParams&gt;
@@ -150,7 +150,7 @@ public class Pool
 
         SharedPoolDataSource tds = new SharedPoolDataSource();
         tds.setConnectionPoolDataSource(cpds);
-        tds.setMaxActive(10);
+        tds.setMaxTotal(10);
         tds.setMaxWaitMillis(50);
 
         ds = tds;
index b13b80d..6f8ec2b 100644 (file)
@@ -32,7 +32,7 @@
 
 <!--
 <section name="Dynamic Properties">
-maxActive
+maxTotal
 maxIdle
 minIdle
 maxWaitMillis
@@ -140,7 +140,7 @@ testWhileIdle
    </td>
 </tr>
 <tr>
-   <td>maxActive</td>
+   <td>maxTotal</td>
    <td>8</td>
    <td>
       The maximum number of active connections that can be allocated from
@@ -392,11 +392,11 @@ Be carefull and only use when you need direct access to driver specific extentio
 <img src="images/icon_info_sml.gif"/>
 If you have enabled "removeAbandoned" then it is possible that a connection is reclaimed by the pool because
 it is considered to be abandoned. This mechanism is triggered when (getNumIdle() &lt; 2) and
-(getNumActive() &gt; getMaxActive() - 3)
+(getNumActive() &gt; getMaxTotal() - 3)
 </p>
 <p>
 <img src="images/icon_info_sml.gif"/>
-For example, maxActive=20 and 18 active connections and 1 idle connection would trigger the "removeAbandoned".
+For example, maxTotal=20 and 18 active connections and 1 idle connection would trigger the "removeAbandoned".
 But only the active connections that aren't used for more then "removeAbandonedTimeout" seconds are removed,
 default (300 sec). Traversing a resultset doesn't count as being used. Creating a Statement, PreparedStatement
 or CallableStatement or using one of these to execute a query (using one of the execute methods) resets
index 10e4ca7..60d950c 100644 (file)
@@ -91,7 +91,7 @@
   Reference ref = new Reference("org.apache.commons.dbcp2.datasources.PerUserPoolDataSource",
     "org.apache.commons.dbcp2.datasources.PerUserPoolDataSourceFactory", null);
   ref.add(new StringRefAddr("dataSourceName", "jdbc/cpds"));
-  ref.add(new StringRefAddr("defaultMaxActive", "100"));
+  ref.add(new StringRefAddr("defaultMaxTotal", "100"));
   ref.add(new StringRefAddr("defaultMaxIdle", "30"));
   ref.add(new StringRefAddr("defaultMaxWaitMillis", "10000"));
   ic.rebind("jdbc/peruser", ref);
index 7d67e36..4c7d11d 100644 (file)
@@ -53,7 +53,7 @@ public class TestBasicDataSourceFactory extends TestCase {
         Properties properties = new Properties();
         properties.setProperty("driverClassName", "org.apache.commons.dbcp2.TesterDriver");
         properties.setProperty("url", "jdbc:apache:commons:testdriver");
-        properties.setProperty("maxActive", "10");
+        properties.setProperty("maxTotal", "10");
         properties.setProperty("maxIdle", "8");
         properties.setProperty("minIdle", "0");
         properties.setProperty("maxWaitMillis", "500");
index 631ad38..2100bd4 100644 (file)
@@ -347,7 +347,7 @@ public class TestPerUserPoolDataSource extends TestConnectionPool {
     public void testPerUserMethods() throws Exception {
         PerUserPoolDataSource tds = (PerUserPoolDataSource) ds;
 
-        // you need to set maxActive otherwise there is no accounting
+        // you need to set per user maxTotal otherwise there is no accounting
         tds.setPerUserMaxTotal("u1", Integer.valueOf(5));
         tds.setPerUserMaxTotal("u2", Integer.valueOf(5));