[cpp-sp COMMIT] /branches/REL_2/odbc-store/odbc-store.cpp
noreply at shibboleth.net
noreply at shibboleth.net
Wed Jul 8 19:16:53 EDT 2015
Author: scantor
Date: Wed Jul 8 19:16:52 2015
New Revision: 3926
URL: http://svn.shibboleth.net/view/cpp-sp?rev=3926&view=rev
Log:
SSPCPP-656 - NameID insert logic appears wrong for ODBC Session store
https://issues.shibboleth.net/jira/browse/SSPCPP-656
Interject an expired record reap when a duplicate insert occurs.
Modified:
branches/REL_2/odbc-store/odbc-store.cpp
Modified: branches/REL_2/odbc-store/odbc-store.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/odbc-store/odbc-store.cpp?rev=3926&r1=3925&r2=3926&view=diff
==============================================================================
--- branches/REL_2/odbc-store/odbc-store.cpp (original)
+++ branches/REL_2/odbc-store/odbc-store.cpp Wed Jul 8 19:16:52 2015
@@ -513,8 +513,15 @@
}
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.");
More information about the commits
mailing list