Hello Group,

We have a use case where we want to create a batch request with change set
containing list of request to be executed.
Below is the sample code for the same:

*BatchRequestFactory batchRequestFactory = client.getBatchRequestFactory();*
*ODataBatchRequest batchRequest =
batchRequestFactory.getBatchRequest(<serviceRoot>);*
*BatchManager payloadManager = batchRequest.payloadManager();*
*ODataChangeset changeSet = payloadManager.addChangeset();*

*// All all the batchable requests present in the list in loop*
*changeSet.addRequest(batchableRequest);*

Once we have added all the requests in the change set we return the created
batch request from our method.
Later we invoke the same batch request like

*request.payloadManager().getResponse();*

Ideally the whole process should make one request i.e single batch request
; but the issue we are facing is that its actually making the two requests.
i.e each time we call request.payloadManager and try to get payload manager.
Once while creating and then while executing the batch request.

When we debugged the further we noticed that every time we do
request.payloadManager, Olingo submits a request to its internal executor
service to execute.

Is this the expected behavior? Shouldn't request.payloadManager just return
the payloadManager without doing anything extra?

Thanks & Regards
Ratish Bansal

Reply via email to