if (error != null)
if (error == null)
    synchronized void invalidate() throws SQLException {        sql = null;                // clear free references        SQLException error = null;        while(!freeReferences.isEmpty()) {            try {                XCachablePreparedStatement result =                    (XCachablePreparedStatement)freeReferences.take();                result.forceClose();            } catch(InterruptedException ex) {                // ignore            } catch(SQLException ex) {                if (error != null)                    error = ex;                else                    error.setNextException(ex);            }        }                // clear working references, even they're currently in use        // since we are invalidating the pool and there's no way back        Iterator iter = workingReferences.entrySet().iterator();        while(iter.hasNext()) {            Map.Entry entry = (Map.Entry)iter.next();                        XCachablePreparedStatement item =                 (XCachablePreparedStatement)entry.getValue();                            try {                item.forceClose();            } catch(SQLException ex) {                if (error == null)                    error = ex;                else                    error.setNextException(ex);            }        }        workingReferences.clear();                if (error != null)            throw error;    }