X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-sp.git;a=blobdiff_plain;f=odbc-store%2Fodbc-store.cpp;h=9fea8722955d2ae01e6e28e6fea25763f908a302;hp=f751271a0f6729d051e77404fd51a75b9d7f4909;hb=4d62ccd06801a5261b1b84e6758bfef641db1e33;hpb=b8d9b32525f1cb7fd38b1a71ce23dbd7637c1931 diff --git a/odbc-store/odbc-store.cpp b/odbc-store/odbc-store.cpp index f751271..9fea872 100644 --- a/odbc-store/odbc-store.cpp +++ b/odbc-store/odbc-store.cpp @@ -513,8 +513,15 @@ bool ODBCStorageService::createRow(const char* table, const char* context, const } m_log.error("insert record failed (t=%s, c=%s, k=%s)", table, context, key); logres = log_error(stmt, SQL_HANDLE_STMT, "23000"); - if (logres.second) - return false; // supposedly integrity violation? + if (logres.second) { + // Supposedly integrity violation. + // Try and delete any expired record still hanging around until the final attempt. + if (attempts > 0) { + reap(table, context); + continue; + } + return false; + } } while (attempts && logres.first); throw IOException("ODBC StorageService failed to insert record.");