Index: res_odbc.c =================================================================== --- res_odbc.c (revision 293920) +++ res_odbc.c (working copy) @@ -597,11 +597,8 @@ ast_log(LOG_WARNING, "Failed to execute, but unable to reconnect, as we're transactional.\n"); break; } else { - obj->up = 0; - ast_log(LOG_WARNING, "SQL Exec Direct failed. Attempting a reconnect...\n"); - - odbc_obj_disconnect(obj); - odbc_obj_connect(obj); + ast_log(LOG_WARNING, "SQL Exec Direct failed. Performing sanity check...\n"); + ast_odbc_sanity_check(obj); } } @@ -643,11 +640,10 @@ ast_log(LOG_WARNING, "SQL Execute error, but unable to reconnect, as we're transactional.\n"); break; } else { - ast_log(LOG_WARNING, "SQL Execute error %d! Attempting a reconnect...\n", res); + ast_log(LOG_WARNING, "SQL Execute error %d! Performing sanity check...\n", res); SQLFreeHandle(SQL_HANDLE_STMT, stmt); stmt = NULL; - obj->up = 0; /* * While this isn't the best way to try to correct an error, this won't automatically * fail when the statement handle invalidates.