Skip to content

Commit

Permalink
Avoid exception on iterative search with paging
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
mederly committed Sep 12, 2018
1 parent 7efd0f4 commit a337f1f
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -826,11 +826,10 @@ public <T extends ObjectType> 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;
Expand Down

0 comments on commit a337f1f

Please sign in to comment.