From a9fad2156e362161dc2c2f704c4bea422f50a938 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Thu, 12 Apr 2012 10:32:41 -0700 Subject: [PATCH] CSPACE-4963: Query for referring objects (records which refer to a particular authority term) temporarily restricted to procedural records, rather than also including cataloging / collectionobject records, to reduce query complexity. --- .../common/vocabulary/AuthorityResource.java | 4 +++- .../common/context/ServiceBindingUtils.java | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java index b43a46cd9..f2d99cd40 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java @@ -745,7 +745,9 @@ public abstract class AuthorityResource List serviceTypes = queryParams.remove(ServiceBindingUtils.SERVICE_TYPE_PROP); if(serviceTypes == null || serviceTypes.isEmpty()) { - serviceTypes = ServiceBindingUtils.getCommonServiceTypes(); + // Temporary workaround for CSPACE-4963 + // serviceTypes = ServiceBindingUtils.getCommonServiceTypes(); + serviceTypes = ServiceBindingUtils.getCommonProcedureServiceTypes(); } // Note that we have to create the service context for the Items, not the main service diff --git a/services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java b/services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java index 58de69b16..ce85932fb 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java @@ -206,6 +206,22 @@ public class ServiceBindingUtils { return commonServiceTypes; } + // Temporary workaround for CSPACE-4963, to help reduce the + // number of service types searched for authority references + // in AuthorityResource.getReferencingObjects(), to in turn + // help reduce database query complexity. + // + // FIXME; this method is intended to be temporary. It was added in part to + // make the effect of the workaround more explicit, and in part to avoid + // breaking the use of the getCommonServiceTypes method in ServiceGroups. + public static ArrayList getCommonProcedureServiceTypes() { + if(commonServiceTypes == null) { + commonServiceTypes = new ArrayList(); + commonServiceTypes.add(SERVICE_TYPE_PROCEDURE); + } + return commonServiceTypes; + } + } -- 2.47.3