public void close() throws SQLException { try { int allocationCount = allConnections.size() - availableConnections.size(); if(allocationCount > 0) { log.error( "Connection leak detected: there are " + allocationCount + " unclosed connections upon shutting down pool " + getUrl()); } } finally { for ( Connection connection : allConnections ) { connection.close(); } } }
public void stop() { statelock.writeLock().lock(); try { if ( !active ) { return; } log.cleaningUpConnectionPool( pool.getUrl() ); active = false; if ( executorService != null ) { executorService.shutdown(); } executorService = null; try { pool.close(); } catch (SQLException e) { log.unableToClosePooledConnection( e ); } } finally { statelock.writeLock().unlock(); } }
public void close() throws SQLException { try { int allocationCount = allConnections.size() - availableConnections.size(); if(allocationCount > 0) { log.error( "Connection leak detected: there are " + allocationCount + " unclosed connections upon shutting down pool " + getUrl()); } } finally { for ( Connection connection : allConnections ) { connection.close(); } } }
public void stop() { statelock.writeLock().lock(); try { if ( !active ) { return; } log.cleaningUpConnectionPool( pool.getUrl() ); active = false; if ( executorService != null ) { executorService.shutdown(); } executorService = null; try { pool.close(); } catch (SQLException e) { log.unableToClosePooledConnection( e ); } } finally { statelock.writeLock().unlock(); } }