FS-2825 add additional info when fail

This commit is contained in:
Jeff Lenk 2010-11-08 08:05:23 -06:00
parent 0a0e79e1fe
commit 4bbd9a4c0f
1 changed files with 5 additions and 2 deletions

View File

@ -702,8 +702,11 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_
if (runtime.odbc_dbtype == DBTYPE_DEFAULT) {
switch_cache_db_execute_sql_real(dbh, "BEGIN", &errmsg);
} else {
if (switch_odbc_SQLSetAutoCommitAttr(dbh->native_handle.odbc_dbh, 0) != SWITCH_ODBC_SUCCESS) {
errmsg = strdup("Unable to Set AutoCommit Off.");;
switch_odbc_status_t result;
if ((result = switch_odbc_SQLSetAutoCommitAttr(dbh->native_handle.odbc_dbh, 0)) != SWITCH_ODBC_SUCCESS) {
char tmp[100];
switch_snprintf(tmp, sizeof(tmp), "%s-%i", "Unable to Set AutoCommit Off", result);
errmsg = strdup(tmp);
}
}