You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Joerg Hoh (Jira)" <ji...@apache.org> on 2022/11/07 13:26:00 UTC
[jira] [Updated] (SLING-11229) Add Option to Limit JCR Resource Provider Queries
[ https://issues.apache.org/jira/browse/SLING-11229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joerg Hoh updated SLING-11229:
------------------------------
Fix Version/s: (was: JCR Resource 3.2.4)
> Add Option to Limit JCR Resource Provider Queries
> -------------------------------------------------
>
> Key: SLING-11229
> URL: https://issues.apache.org/jira/browse/SLING-11229
> Project: Sling
> Issue Type: Improvement
> Components: JCR
> Affects Versions: JCR Resource 3.2.0
> Reporter: Dan Klco
> Assignee: Dan Klco
> Priority: Major
> Time Spent: 2h 50m
> Remaining Estimate: 0h
>
> **Problem Statement**
> Currently, the [BasicQueryLanguageProvider |https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/18edb8d7e7106c1e1e3333b89bf4d2a49c686e3b/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/BasicQueryLanguageProvider.java] used by the [JCRResourceProvider|https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/8345f4ed4857ed5ca240ac20050b68c84c61646c/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java] for executing queries for methods like findResources executes a query without a limit set.
> At the same time, in Apache Jackrabbit Oak, queries will fail if the query reads more than a configurable limit of nodes:
> [https://jackrabbit.apache.org/oak/docs/query/query-engine.html#Slow_Queries_and_Read_Limits]
> This means that it's entirely possible to create a well indexed, well crafted query in Apache Sling that will still throw an Exception at runtime for larger repositories when using [ResourceResolver.findResources|https://sling.apache.org/apidocs/sling12/org/apache/sling/api/resource/ResourceResolver.html#findResources-java.lang.String-java.lang.String-] or [ResourceResolver.queryResources|https://sling.apache.org/apidocs/sling12/org/apache/sling/api/resource/ResourceResolver.html#queryResources-java.lang.String-java.lang.String-] if the query returns more than the Oak Read limit number of results.
> **Solution**
> Add an optional setting to the JCR Resource Provider to set a limit on the number of returned results from queries. While this would mean that in certain cases the queries would return an incomplete set of results, they would still nevertheless return results rather than failing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)