From: Anthony Minessale Date: Wed, 30 Jun 2010 14:05:14 +0000 (-0500) Subject: share handles when not using sqlite X-Git-Tag: v1.2-rc1~565^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e11560ddf3f39c8443ccbb427102760f93751dc4;p=thirdparty%2Ffreeswitch.git share handles when not using sqlite --- diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 2ce23de97f..38caa03478 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -77,7 +77,7 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t } -#define SQL_CACHE_TIMEOUT 300 +#define SQL_CACHE_TIMEOUT 120 static void sql_close(time_t prune) { @@ -155,6 +155,17 @@ SWITCH_DECLARE(void) switch_cache_db_flush_handles(void) SWITCH_DECLARE(void) switch_cache_db_release_db_handle(switch_cache_db_handle_t ** dbh) { if (dbh && *dbh) { + + switch ((*dbh)->type) { + case SCDB_TYPE_ODBC: + { + switch_clear_flag((*dbh), CDF_INUSE); + } + break; + default: + break; + } + switch_mutex_unlock((*dbh)->mutex); *dbh = NULL; }