]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
share handles when not using sqlite
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 30 Jun 2010 14:05:14 +0000 (09:05 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 30 Jun 2010 14:05:14 +0000 (09:05 -0500)
src/switch_core_sqldb.c

index 2ce23de97f2b0ea809e122fa13ae3cff7c1c09a0..38caa03478f48e379e5b2993801bfef4119bc4b0 100644 (file)
@@ -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;
        }