From a337f1fb898d84cbc827aa8dc16c803ca2dbb8e4 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Wed, 12 Sep 2018 16:35:26 +0200 Subject: [PATCH] Avoid exception on iterative search with paging When searchObjectsIterative is called in state that implicitly results in iteration based on strictly sequential paging, and an incompatible custom paging is requested, we now issue a warning and switch to SIMPLE_PAGING iteration. (Originally we thrown an exception there.) --- .../evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java index 36c83cdaf80..258bc4bef97 100644 --- a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java +++ b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java @@ -826,11 +826,10 @@ public SearchResultMetadata searchObjectsIterative(Class< if (isCustomPagingOkWithPagedSeqIteration(query)) { iterationMethod = IterationMethodType.STRICTLY_SEQUENTIAL_PAGING; } else { - // TODO switch to LOGGER.error - throw new IllegalArgumentException("Iterative search was defined in the repository configuration, and strict sequentiality " + LOGGER.warn("Iterative search was defined in the repository configuration, and strict sequentiality " + "was requested. However, a custom paging precludes its application. Therefore switching to " + "simple paging iteration method. Paging requested: " + query.getPaging()); - //iterationMethod = IterationMethodType.SIMPLE_PAGING; + iterationMethod = IterationMethodType.SIMPLE_PAGING; } } else { iterationMethod = IterationMethodType.SIMPLE_PAGING;