Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (17480 => 17481)
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c 2010-05-04 13:33:39 UTC (rev 17480)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c 2010-05-04 14:50:55 UTC (rev 17481)
@@ -1784,7 +1784,7 @@
cb.nplen = nplen;
switch_assert(sql != NULL);
- sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_nonce_callback, &cb);
+ sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_reg_nonce_callback, &cb);
free(sql);
//if (!sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, np, nplen)) {
Modified: freeswitch/trunk/src/switch_core_sqldb.c (17480 => 17481)
--- freeswitch/trunk/src/switch_core_sqldb.c 2010-05-04 13:33:39 UTC (rev 17480)
+++ freeswitch/trunk/src/switch_core_sqldb.c 2010-05-04 14:50:55 UTC (rev 17481)
@@ -109,7 +109,7 @@
if (switch_mutex_trylock(dbh->mutex) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Dropping idle DB connection %s\n", key);
-
+
switch (dbh->type) {
case SCDB_TYPE_ODBC:
{
@@ -719,6 +719,7 @@
status = switch_core_db_exec(dbh->native_handle.core_db_dbh, sql, callback, pdata, &errmsg);
if (errmsg) {
+ dbh->last_used = switch_epoch_time_now(NULL) - (SQL_CACHE_TIMEOUT * 2);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR: [%s] %s\n", sql, errmsg);
free(errmsg);
}