final BoneCP pool = connectionHandle.getPool(); connectionHandle.getPool().getFinalizableRefs().put(internalDBConnection, new FinalizableWeakReference<ConnectionHandle>(connectionHandle, connectionHandle.getPool().getFinalizableRefQueue()) { @SuppressWarnings("synthetic-access") public void finalizeReferent() {
this.connectionHandle = connectionHandle; this.logStatementsEnabled = logStatementsEnabled; BoneCPConfig config = connectionHandle.getPool().getConfig(); this.connectionHook = config.getConnectionHook(); this.statistics = connectionHandle.getPool().getStatistics(); this.statisticsEnabled = config.isStatisticsEnabled();
ConnectionHook connectionHook = con.getPool().getConfig().getConnectionHook(); int acquireRetryAttempts = con.getPool().getConfig().getAcquireRetryAttempts(); long acquireRetryDelay = con.getPool().getConfig().getAcquireRetryDelayInMs(); AcquireFailConfig acquireConfig = new AcquireFailConfig(); acquireConfig.setAcquireRetryAttempts(new AtomicInteger(acquireRetryAttempts)); con.setInternalConnection(memorize(con.getPool().obtainInternalConnection(con), con)); } catch(SQLException e){ throw con.markPossiblyBroken(e);