]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
switch to switch_cache_db_dismiss_db_handle to reduce odbc
authorRupa Schomaker <rupa@rupa.com>
Tue, 29 Jun 2010 21:00:44 +0000 (16:00 -0500)
committerRupa Schomaker <rupa@rupa.com>
Tue, 29 Jun 2010 21:00:44 +0000 (16:00 -0500)
usage under heavy switch load

src/mod/applications/mod_cidlookup/mod_cidlookup.c [changed mode: 0755->0644]
src/mod/applications/mod_db/mod_db.c

old mode 100755 (executable)
new mode 100644 (file)
index 230c48a..76239cb
@@ -143,7 +143,7 @@ static switch_status_t config_callback_dsn(switch_xml_config_item_t *data, const
        switch_goto_status(SWITCH_STATUS_SUCCESS, done);
 
   done:
-       switch_cache_db_release_db_handle(&dbh);
+       switch_cache_db_dismiss_db_handle(&dbh);
        return status;
 }
 
@@ -198,7 +198,7 @@ static switch_bool_t cidlookup_execute_sql_callback(char *sql, switch_core_db_ca
                *err = switch_core_sprintf(cbt->pool, "Unable to get ODBC handle.  dsn: %s, dbh is %s\n", globals.odbc_dsn, dbh ? "not null" : "null");
        }
 
-       switch_cache_db_release_db_handle(&dbh);
+       switch_cache_db_dismiss_db_handle(&dbh);
        return retval;
 }
 
index b4c76d273a4382dc9f107d494a79d85988efa48f..6bf08a3c98a828ed0b083a320f506426312bcef8 100644 (file)
@@ -122,7 +122,7 @@ static switch_status_t limit_execute_sql(char *sql)
 
   end:
 
-       switch_cache_db_release_db_handle(&dbh);
+       switch_cache_db_dismiss_db_handle(&dbh);
 
        return status;
 }
@@ -148,7 +148,7 @@ static switch_bool_t limit_execute_sql_callback(char *sql, switch_core_db_callba
 
   end:
 
-       switch_cache_db_release_db_handle(&dbh);
+       switch_cache_db_dismiss_db_handle(&dbh);
 
        return ret;
 }
@@ -344,6 +344,7 @@ static switch_status_t do_config()
                sql = switch_mprintf("delete from limit_data where hostname='%q';", globals.hostname);
                limit_execute_sql(sql);
                switch_safe_free(sql);
+               switch_cache_db_dismiss_db_handle(&dbh); /* try to really free the connection */
        }
 
        return status;