Project

General

Profile

« Previous | Next » 

Revision 5933

Added by berkley almost 14 years ago

added some debug info to DBConnectionPool

View differences:

src/edu/ucsb/nceas/metacat/database/DBConnectionPool.java
565 565
                logMetacat.warn("DBConnectionPool.run - Warning for connection " +
566 566
                		dbConn.getTag() + " : " + dbConn.getWarningMessage());
567 567
              }
568
              logMetacat.info("Checking if the db connection " + dbConn.toString() + " is valid according to metacat.properties parameters.");
569
              System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Checking if the db connection " + dbConn.toString() + " is valid according to metacat.properties parameters.");
568 570
              //check if it is valiate, if not create new one and replace old one
569 571
              if (!validateDBConnection(dbConn))
570 572
              {
573
                System.out.println("DB connection is not valid!  Releasing it.");
571 574
                logMetacat.debug("DBConnectionPool.run - Recyle: " + dbConn.getTag());
572 575
                //close this DBConnection
573 576
                dbConn.close();
......
576 579
                //insert a new DBConnection to same palace
577 580
                dbConn = new DBConnection();
578 581
                connectionPool.insertElementAt(dbConn, i);
582
                System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@db connection released: " + dbConn.toString());
579 583
               }//if
580 584
            }//try
581 585
            catch (SQLException e)
582 586
            {
583 587
              logMetacat.error("DBConnectionPool.run - SQL error: " + e.getMessage());
584 588
            }//catch
589
            
590
            System.out.println("number of connections in pool: " + connectionPool.size());
591
            System.out.println("connection pool capacity: " + connectionPool.capacity());
592
            
585 593
          }//if
586 594
        }//for
587 595
      }//synchronize   

Also available in: Unified diff