/** * Flushes the open {@link CallableStatement} cache for this connection. * @throws SQLException if thrown while attempting to flush statements */ protected void flushOpenCallableStatements() throws SQLException { synchronized(csUsed) { int count = csUsed.size(); if (count > 0) { log_debug(pool.getName() + ": Closing " + count + " open CallableStatement" + (count != 1 ? "s" : "")); while (!csUsed.isEmpty()) (csUsed.remove(0)).release(); } } }
/** * Flushes the spare {@link CallableStatement} cache for this connection. * @throws SQLException if thrown while attempting to flush statements */ protected void flushSpareCallableStatements() throws SQLException { synchronized(cs) { int count = cs.size(); if (count > 0) { log_debug(pool.getName() + ": Closing " + count + " cached CallableStatement" + (count != 1 ? "s" : "")); for (List<CachedCallableStatement> list : cs.values()) { for (CachedCallableStatement ccs : list) ccs.release(); } cs.clear(); } } }