cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I am making two calls of sap.ui.model.odata.read method one after the other with different entitiy sets.

Since UI5 has inbuilt capability to send both GET operations in a single batch request, i can see only one $batch request in console.

When i checked this $batch call under 'Network' tab in chrome console, i saw there are two GET commands one after the other under 'Request Payload' and this whole $batch request is taking 3 seconds.

Whereas each of these read calls spearately takes 1.5 seconds.

-->So, i think when i make two read calls one after the other, browser is actually calling them sequentially.

What i want to achieve is to make two $batch requests for odata.read calls, which are written one after the other.

Is it possible with some settings or any sample code ?

BR,
Venky.

0 Likes
View Entire Topic
Former Member
0 Likes

Check this link and scroll down to "Batch Processing"

venkatesha_n
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Radek,

Thanks for your help.

I am using oDataModel.v2 api:

I followed the same link and tried it--> not working(still single batch call for two subsequent oDataModel.read calls).

in this link https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/6c47b2b39db9404582994070ec3d57a2.html There is one code line:

oModel.submitChanges({groupId:"myGroupId", success: mySuccessHandler, error: myErrorHandler});

There is a success call function in the above statement, i think i should give success call back function in the oDataModel.read call, not here right ?

BR,
Venky.

Former Member

In oModel.read the success callback will trigger each time for a successfully read entry even if it is batch processing. You can either use submitChanges then success will trigger once per processed batch or use oModel.read and attach event batchRequestCompleted which will trigger once per batch.