docs: @Override
  	@Transactional(propagation = Propagation.NEVER)
  	public List<Long> getResources(final String theUuid, int theFrom, int theTo) {
  		TransactionTemplate txTemplate = new TransactionTemplate(myManagedTxManager);
  		txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
  
  		Search search;
  		StopWatch sw = new StopWatch();
  		while (true) {
  
  			if (myNeverUseLocalSearchForUnitTests == false) {
  				BaseTask task = myIdToSearchTask.get(theUuid);
  				if (task != null) {
  					ourLog.trace("Local search found");
  					List<Long> resourcePids = task.getResourcePids(theFrom, theTo);
  					if (resourcePids != null) {
  						return resourcePids;
  					}
  				}
  			}
  
  			search = txTemplate.execute(t -> mySearchDao.findByUuid(theUuid));
  
  			if (search == null) {
  				ourLog.debug("Client requested unknown paging ID[{}]", theUuid);
  				String msg = myContext.getLocalizer().getMessage(PageMethodBinding.class, "unknownSearchId", theUuid);
  				throw new ResourceGoneException(msg);
  			}
  
  			verifySearchHasntFailedOrThrowInternalErrorException(search);
  			if (search.getStatus() == SearchStatusEnum.FINISHED) {
  				ourLog.debug("Search entity marked as finished with {} results", search.getNumFound());
  				break;
  			}
  			if (search.getNumFound() >= theTo) {
  				ourLog.debug("Search entity has {} results so far", search.getNumFound());
  				break;
  			}
  
  			if (sw.getMillis() > myMaxMillisToWaitForRemoteResults) {
  				ourLog.error("Search {} of type {} for {}{} timed out after {}ms", search.getId(), search.getSearchType(), search.getResourceType(), search.getSearchQueryString(), sw.getMillis());
  				throw new InternalErrorException("Request timed out after " + sw.getMillis() + "ms");
  			}
  
  			// If the search was saved in "pass complete mode" it's probably time to
  			// start a new pass
  			if (search.getStatus() == SearchStatusEnum.PASSCMPLET) {
  				Optional<Search> newSearch = tryToMarkSearchAsInProgress(search);
  				if (newSearch.isPresent()) {
  					search = newSearch.get();
  					String resourceType = search.getResourceType();
  					SearchParameterMap params = search.getSearchParameterMap();
  					IFhirResourceDao<?> resourceDao = myDaoRegistry.getResourceDao(resourceType);
  					SearchContinuationTask task = new SearchContinuationTask(search, resourceDao, params, resourceType);
  					myIdToSearchTask.put(search.getUuid(), task);
  					myExecutor.submit(task);
  				}
  			}
  
  			try {
  				Thread.sleep(500);
  			} catch (InterruptedException e) {
  				// ignore
  			}
  		}
  
  		final Pageable page = toPage(theFrom, theTo);
  		if (page == null) {
  			return Collections.emptyList();
  		}
  
  		final Search foundSearch = search;
  
  		ourLog.trace("Loading stored search");
  		List<Long> retVal = txTemplate.execute(theStatus -> {
  			final List<Long> resultPids = new ArrayList<>();
  			Page<Long> searchResultPids = mySearchResultDao.findWithSearchUuid(foundSearch, page);
  			for (Long next : searchResultPids) {
  				resultPids.add(next);
  			}
  			return resultPids;
  		});
  		return retVal;
  	}