public bool close_conn() { bool res = false; try { db_provider db = db_conn; if (db.is_opened()) { db.close_conn(); res = true; } _db_connected = false; } catch (Exception ex) { log.log_err(ex); _db_connected = false; } return(res); }
public bool db_reconn(bool throw_err = false) { try { db_provider db = db_conn; if (db.is_opened()) { db.close_conn(); } _db_connected = db.open_conn(); } catch (Exception ex) { log.log_err(ex); _db_connected = false; if (throw_err) { throw ex; } } return(_db_connected); }