[metacat-cvs] metacat/src/edu/ucsb/nceas/metacat DBConnectionPool.java

Saurabh Garg sgarg at ecoinformatics.org
Wed Nov 2 11:07:07 PST 2005


sgarg       05/11/02 11:07:07

  Modified:    src/edu/ucsb/nceas/metacat DBConnectionPool.java
  Log:
  Modified the WARNing message
  
  Revision  Changes    Path
  1.17      +14 -8     metacat/src/edu/ucsb/nceas/metacat/DBConnectionPool.java
  
  Index: DBConnectionPool.java
  ===================================================================
  RCS file: /cvs/metacat/src/edu/ucsb/nceas/metacat/DBConnectionPool.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DBConnectionPool.java	2 Nov 2005 18:16:54 -0000	1.16
  +++ DBConnectionPool.java	2 Nov 2005 19:07:07 -0000	1.17
  @@ -8,8 +8,8 @@
    *    Release: @release@
    *
    *   '$Author: sgarg $'
  - *     '$Date: 2005/11/02 18:16:54 $'
  - * '$Revision: 1.16 $'
  + *     '$Date: 2005/11/02 19:07:07 $'
  + * '$Revision: 1.17 $'
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
  @@ -651,15 +651,15 @@
        DBConnection conn = null; // the dbconnection
        connectionPoolSize = connectionPool.size();
        freeConnectionSize = getFreeDBConnectionNumber();
  +     difference = connectionPoolSize - freeConnectionSize;
  +
        if(freeConnectionSize < connectionPoolSize){
  -    	 int numberOfConnections = connectionPoolSize - freeConnectionSize;
  -    	 logMetacat.warn(numberOfConnections + "connections " +
  -    	 		"being used out of " +connectionPoolSize + " connections");
  +    	 logMetacat.warn(difference + " connection(s) " +
  +                        "being used and connection pool size is " +connectionPoolSize);
        } else {
       	 logMetacat.info("Connection pool size: " +connectionPoolSize);
       	 logMetacat.info("Free Connection number: "+freeConnectionSize);
        }
  -     difference = connectionPoolSize - freeConnectionSize;
        
        //If all connections are free and connection pool size greater than 
        //initial value, shrink connection pool size to intital value
  @@ -719,9 +719,15 @@
        DBConnection conn = null; // the dbconnection
        connectionPoolSize = connectionPool.size();
        freeConnectionSize = getFreeDBConnectionNumber();
  -     logMetacat.warn("Connection pool size: " +connectionPoolSize);
  -     logMetacat.warn("Free Connection number: "+freeConnectionSize);
        difference = connectionPoolSize - freeConnectionSize;
  +
  +     if(freeConnectionSize < connectionPoolSize){
  +         logMetacat.warn(difference + " connection(s) " +
  +                        "being used and connection pool size is " +connectionPoolSize);
  +     } else {
  +         logMetacat.info("Connection pool size: " +connectionPoolSize);
  +         logMetacat.info("Free Connection number: "+freeConnectionSize);
  +     }
        
        //If all connections are free and connection pool size greater than 
        //initial value, shrink connection pool size to intital value
  
  
  


More information about the Metacat-cvs mailing list