Iterator iter = workingReferences.iterator(); while(iter.hasNext()) { XCachablePreparedStatement item = (XCachablePreparedStatement)iter.next();  try { item.forceClose(); } catch(SQLException ex) { if (error != null) error = ex; else error.setNextException(ex); } } workingReferences.clear();  if (error != null) throw error;
    synchronized void invalidate() throws SQLException {        sql = null;                while(!freeReferences.isEmpty()) {            try {                XCachablePreparedStatement result =                    (XCachablePreparedStatement)freeReferences.take();                result.forceClose();            } catch(InterruptedException ex) {                // ignore            }        }    }