comparison backend/src/main/java/org/dive4elements/river/backend/utils/DBCPConnectionProvider.java @ 8708:d718edbf0b0c

Change database connection debug output to traces
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 24 Apr 2015 12:45:55 +0200
parents 026f4c684ee5
children 8179cca1796a
comparison
equal deleted inserted replaced
8707:f0ea2063b58e 8708:d718edbf0b0c
251 } 251 }
252 log.debug("Configure DBCPConnectionProvider complete"); 252 log.debug("Configure DBCPConnectionProvider complete");
253 } 253 }
254 254
255 public Connection getConnection() throws SQLException { 255 public Connection getConnection() throws SQLException {
256 log.debug("Connection pool parameters:"); 256 log.trace("Connection pool parameters:");
257 log.debug("_ active connections: " + ds.getNumActive()); 257 log.trace("_ active connections: " + ds.getNumActive());
258 log.debug("_ idle connections: " + ds.getNumIdle()); 258 log.trace("_ idle connections: " + ds.getNumIdle());
259 log.debug("_ max active: " + ds.getMaxActive()); 259 log.trace("_ max active: " + ds.getMaxActive());
260 if (ds.getNumActive() == ds.getMaxActive()) { 260 if (ds.getNumActive() == ds.getMaxActive()) {
261 log.warn("Maximum number of database connections in pool in use!"); 261 log.warn("Maximum number of database connections in pool in use!");
262 } 262 }
263 Connection conn = ds.getConnection(); 263 Connection conn = ds.getConnection();
264 log.debug("Return connection with hash: " + conn.hashCode()); 264 log.trace("Return connection with hash: " + conn.hashCode());
265 return conn; 265 return conn;
266 } 266 }
267 267
268 public void closeConnection(Connection conn) throws SQLException { 268 public void closeConnection(Connection conn) throws SQLException {
269 log.debug("Close connection with hash: " + conn.hashCode()); 269 log.trace("Close connection with hash: " + conn.hashCode());
270 conn.close(); 270 conn.close();
271 } 271 }
272 272
273 public void close() throws HibernateException { 273 public void close() throws HibernateException {
274 try { 274 try {

http://dive4elements.wald.intevation.org