on 04-26-2021 2:22 PM
Background: I've created an Odata Service that exposes 2 entity sets, one from a custom table and one from SAP Standard tables. Both entity sets will return a significant amount of records, and as such, server side pagination is required. The pagination would only make sense if I enable soft-state, otherwise, subsequent calls to the 'NEXT' link will always get the data from the database.
What I've done so far (based on this link and this link😞
Issue Encountered: I'm testing the service in the gateway client. The payload is paginated, i.e. returns only 100 records including the link to the next skip token (next 100 items). When executing the link for the next 100 records, the service is not accessing the created internal session supposedly where the cached data is, therefore, getting data from the database again and creating another internal session - I checked that in AL08, every time I execute the query, a new session is created. I tried using the "Reuse HTTP Connection (e.g. for soft-state)" option, but when I execute a query for the 'next' skip token link, I get a 404 - indicating that the service is not found.
Help Needed: How do I ensure that the subsequent queries in GW_CLIENT for the 'NEXT' link will access the cached data instead of going thru the database again?
**Update: we tested the service call from SAP CPI and every call for the subsequent page creates a new user session instead of using the resources of the initial load.
Thanks
Frank
What is the release you're running on? Would using CDS be an option? There you get client side paging with $top & $skip for free.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Usually what we recommend is to follow this Blog below. Do you see any significant difference between your implementation and/or config? One important part might be, is adding the below line in the DEFINE method:
model->set_soft_state_enabled( abap_true ).
#4 – How To Use Delta Query and Server Side Paging with Soft State
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.