This commit is contained in:
Anthony Minessale committed 2010-07-23 16:15:10 -05:00
1 parent 8670318855
commit 9a667aeb1f
2 files changed
+79 -18

No files matched your search

+7 -3
View File
@@ -385,10 +385,12 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
new_dbh->hash = switch_ci_hashfunc_default(db_str, &hlen);
if (db)
if (db) {
new_dbh->native_handle.core_db_dbh = db;
else
} else {
new_dbh->native_handle.odbc_dbh = odbc_dbh;
}
switch_mutex_init(&new_dbh->mutex, SWITCH_MUTEX_UNNESTED, new_dbh->pool);
switch_set_string(new_dbh->creator, db_callsite_str);
switch_mutex_lock(new_dbh->mutex);
@@ -398,8 +400,9 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
end:
if (new_dbh)
if (new_dbh) {
new_dbh->last_used = switch_epoch_time_now(NULL);
}
switch_mutex_unlock(sql_manager.dbh_mutex);
@@ -1605,6 +1608,7 @@ void switch_core_sqldb_stop(void)
switch_thread_join(&st, sql_manager.thread);
}
switch_cache_db_flush_handles();
sql_close(0);
switch_core_hash_destroy(&sql_manager.dbh_hash);