close connections and result sets