Stream: hapi
Topic: Why DatabaseBackedPagingProvider storeResultList does not...
Markku Nikkanen (Jul 22 2020 at 09:11):
I am trying to get pagination working. Been debugging why it does not operate. Following error is thrown
Search ID \"ad911760-3c5c-46dc-b203-1e3fe7b8656f\" does not exist and may have expired
... when next url is called:
{
"resourceType": "Bundle",
"id": "ad911760-3c5c-46dc-b203-1e3fe7b8656f",
"meta": {
"lastUpdated": "2020-07-22T13:48:09.285+03:00"
},
"type": "searchset",
"total": 5,
"link": [
{
"relation": "self",
"url": "http://localhost:8080/fhir/Encounter?_count=1&_getpagesoffset=0"
},
{
"relation": "next",
"url": "http://localhost:8080/fhir?_getpages=ad911760-3c5c-46dc-b203-1e3fe7b8656f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
}
],
Just realised that storeResultList does not presist uuid and for that reason retrieveResultList does return null.
public class DatabaseBackedPagingProvider extends BasePagingProvider implements IPagingProvider {
...
@Override
public synchronized IBundleProvider retrieveResultList(RequestDetails theRequestDetails, String theId) {
IFhirSystemDao<?, ?> systemDao = myDaoRegistry.getSystemDao();
PersistedJpaBundleProvider provider = new PersistedJpaBundleProvider(theRequestDetails, theId, systemDao, mySearchBuilderFactory);
if (!provider.ensureSearchEntityLoaded()) {
return null;
}
return provider;
}
@Override
public synchronized String storeResultList(RequestDetails theRequestDetails, IBundleProvider theList) {
String uuid = theList.getUuid();
return uuid;
}
Last updated: Apr 12 2022 at 19:14 UTC