]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4740: RefNameServiceUtils method that updates refnames (updateAuthorityRefDocs...
authorRichard Millet <richard.millet@berkeley.edu>
Fri, 16 Dec 2011 07:54:24 +0000 (07:54 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Fri, 16 Dec 2011 07:54:24 +0000 (07:54 +0000)
services/authentication/service/src/main/java/org/collectionspace/authentication/realm/db/CSpaceDbRealm.java
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java
services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java

index 887017f5f9ba6db7b3486c7fd54d6a36633878a8..759de6a2b2483248733e90da8f8814803b74dfcb 100644 (file)
@@ -150,7 +150,10 @@ public class CSpaceDbRealm implements CSpaceRealm {
 
             password = rs.getString(1);
         } catch (SQLException ex) {
-            LoginException le = new LoginException("Query failed");
+               if (logger.isTraceEnabled() == true) {
+                       logger.error("Could not open database to read AuthN tables.", ex);
+               }
+            LoginException le = new LoginException("Authentication query failed: " + ex.getLocalizedMessage());
             le.initCause(ex);
             throw le;
         } catch (Exception ex) {
index a4365e1e71416b21bc4fb4a6a11e609cb7c38afd..0daa61835bf462358f29620f38e2e4da97ffa91f 100644 (file)
@@ -62,6 +62,7 @@ import org.nuxeo.ecm.core.api.DocumentModel;
 import org.nuxeo.ecm.core.api.model.PropertyException;
 import org.nuxeo.ecm.core.api.model.PropertyNotFoundException;
 import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
+import org.nuxeo.runtime.transaction.TransactionHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -268,8 +269,9 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
     /**
      * Checks to see if the refName has changed, and if so, 
      * uses utilities to find all references and update them.
+     * @throws Exception 
      */
-    protected void handleItemRefNameReferenceUpdate() {
+    protected void handleItemRefNameReferenceUpdate() throws Exception {
         if (newRefNameOnUpdate != null && oldRefNameOnUpdate != null) {
             // We have work to do.
             if (logger.isDebugEnabled()) {
index ab2efb03c1aac1aad06a25f326ae10087a94a472..b0272b0a8d19bac929eaafab800ab7f3f1328161 100644 (file)
@@ -267,7 +267,7 @@ public class RefNameServiceUtils {
             RepositoryInstance repoSession,\r
             String oldRefName,\r
             String newRefName,\r
-            String refPropName ) {\r
+            String refPropName ) throws Exception {\r
         Map<String, ServiceBindingType> queriedServiceBindings = new HashMap<String, ServiceBindingType>();\r
         Map<String, List<AuthRefConfigInfo>> authRefFieldsByService = new HashMap<String, List<AuthRefConfigInfo>>();\r
         int nRefsFound = 0;\r
@@ -300,9 +300,10 @@ public class RefNameServiceUtils {
                        }\r
                        pageNumProcessed++;\r
                }\r
-        } catch(Exception e) {\r
+        } catch (Exception e) {\r
                logger.error("Internal error updating the AuthorityRefDocs: " + e.getLocalizedMessage());\r
                logger.debug(Tools.errorToString(e, true));\r
+               throw e;\r
         }\r
                logger.debug("updateAuthorityRefDocs replaced a total of: "+nRefsFound);\r
         return nRefsFound;\r