@Override public synchronized void close() { try { switch (state.type) { case ZERO: break; case NORMAL: if (log.isDebugEnabled()) { log.debug( "Closing connection pool: {}", connConfig, new RuntimeException("Closing connection pool")); } state.dataSourcePool.close(); break; case CLOSED: break; } } finally { state = new State(StateType.CLOSED, null, null, new Throwable("Hikari pool closed here")); } }
@Override public synchronized void close() { try { switch (state.type) { case ZERO: break; case NORMAL: if (log.isDebugEnabled()) { log.debug( "Closing connection pool: {}", connConfig, new RuntimeException("Closing connection pool")); } state.dataSourcePool.close(); break; case CLOSED: break; } } finally { state = new State(StateType.CLOSED, null, null, new Throwable("Hikari pool closed here")); } }
private State normalState() throws SQLException { HikariDataSource dataSourcePool = getDataSourcePool(); boolean keep = false; try { // Setup monitoring HikariPoolMXBean poolProxy = initPoolMbeans(); testDataSource(dataSourcePool); keep = true; return new State(StateType.NORMAL, dataSourcePool, poolProxy, null); } finally { if (!keep) { IOUtils.closeQuietly(dataSourcePool); } } }
private State normalState() throws SQLException { HikariDataSource dataSourcePool = getDataSourcePool(); boolean keep = false; try { // Setup monitoring HikariPoolMXBean poolProxy = initPoolMbeans(); testDataSource(dataSourcePool); keep = true; return new State(StateType.NORMAL, dataSourcePool, poolProxy, null); } finally { if (!keep) { IOUtils.closeQuietly(dataSourcePool); } } }