commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp BasicDataSourceFactory.java BasicDataSource.java
Date Thu, 21 Aug 2003 19:00:26 GMT
dirkv       2003/08/21 12:00:26

  Modified:    dbcp/src/java/org/apache/commons/dbcp
                        BasicDataSourceFactory.java BasicDataSource.java
  Log:
  Bugzilla Bug 22598
    minIdle Functionality for DBCP via Patches Posted for commons-pool
  
  patch by Richard Wareing
  
  Revision  Changes    Path
  1.6       +10 -4     jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java
  
  Index: BasicDataSourceFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BasicDataSourceFactory.java	6 Mar 2003 15:22:25 -0000	1.5
  +++ BasicDataSourceFactory.java	21 Aug 2003 19:00:26 -0000	1.6
  @@ -153,6 +153,12 @@
                   (Integer.parseInt(ra.getContent().toString()));
           }
   
  +        ra = ref.get("minIdle");
  +        if (ra != null) {
  +            dataSource.setMinIdle
  +                (Integer.parseInt(ra.getContent().toString()));
  +        }
  +
           ra = ref.get("maxWait");
           if (ra != null) {
               dataSource.setMaxWait
  
  
  
  1.18      +18 -4     jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java
  
  Index: BasicDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- BasicDataSource.java	11 Aug 2003 16:11:34 -0000	1.17
  +++ BasicDataSource.java	21 Aug 2003 19:00:26 -0000	1.18
  @@ -161,6 +161,19 @@
           this.maxIdle = maxIdle;
       }
   
  +    /**
  +     * The minimum number of active connections that can remain idle in the
  +     * pool, without extra ones being created, or 0 to create none.
  +     */
  +    protected int minIdle = GenericObjectPool.DEFAULT_MIN_IDLE;;
  +
  +    public int getMinIdle() {
  +        return (this.minIdle);
  +    }
  +
  +    public void setMinIdle(int minIdle) {
  +       this.minIdle = minIdle;
  +    }
   
       /**
        * The maximum number of milliseconds that the pool will wait (when there
  @@ -652,6 +665,7 @@
           connectionPool = new GenericObjectPool();
           connectionPool.setMaxActive(maxActive);
           connectionPool.setMaxIdle(maxIdle);
  +        connectionPool.setMinIdle(minIdle);
           connectionPool.setMaxWait(maxWait);
           connectionPool.setTestOnBorrow(testOnBorrow);
           connectionPool.setTestOnReturn(testOnReturn);
  
  
  

Mime
View raw message