From e11560ddf3f39c8443ccbb427102760f93751dc4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 30 Jun 2010 09:05:14 -0500 Subject: [PATCH] share handles when not using sqlite --- src/switch_core_sqldb.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; }