[java-identity-provider COMMIT] /trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/JDBCPersistent...

noreply at shibboleth.net noreply at shibboleth.net
Wed Sep 7 12:12:45 EDT 2016


Author: scantor
Date: Wed Sep  7 12:12:45 2016
New Revision: 8376

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8376&view=rev
Log:
IDP-1032 - NullPointerException in JDBCPersistentIdStoreEx when MySQL is busy

https://issues.shibboleth.net/jira/browse/IDP-1032

Modified:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/JDBCPersistentIdStoreEx.java

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/JDBCPersistentIdStoreEx.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/JDBCPersistentIdStoreEx.java?rev=8376&r1=8375&r2=8376&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/JDBCPersistentIdStoreEx.java	(original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/JDBCPersistentIdStoreEx.java	Wed Sep  7 12:12:45 2016
@@ -612,7 +612,7 @@
             } catch (final SQLException e) {
                 boolean retry = false;
                 for (final String msg : retryableErrors) {
-                    if (e.getSQLState().contains(msg)) {
+                    if (e.getSQLState() != null && e.getSQLState().contains(msg)) {
                         log.warn("{} Caught retryable SQL exception", getLogPrefix(), e);
                         retry = true;
                     }
@@ -806,7 +806,7 @@
             store(newEntry, conn);
             keyMissing = true;
         } catch (final SQLException e) {
-            if (!retryableErrors.contains(e.getSQLState())) {
+            if (e.getSQLState() != null && !retryableErrors.contains(e.getSQLState())) {
                 log.warn("{} Duplicate insert failed as required with SQL State '{}', ensure this value is "
                         + "configured as a retryable error", getLogPrefix(), e.getSQLState());
             }



More information about the commits mailing list