cancel
Showing results for 
Search instead for 
Did you mean: 

Batch Request with Offline Store iOS

Former Member
0 Kudos

Hi Experts,

Have anyone tried batch request with Offline Store in iOS?

I followed http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/202ed7ed-6b58-3210-bbbb-cde7ba5ed... H2G and created a batch request with a single read request.

Code :


  self.batchRequestParam = [[SODataRequestParamBatchDefault alloc] init];

  SODataRequestParamSingleDefault *requestParamSalesOrders = [[SODataRequestParamSingleDefault alloc] initWithMode:SODataRequestModeRead resourcePath:[NSString stringWithFormat:@"%@/SalesOrders", [MyLogonHandler shared].data.applicationEndpointURL]];

       

         SODataRequestParamSingleDefault *requestParamSalesOrderItems = [[SODataRequestParamSingleDefault alloc] initWithMode:SODataRequestModeRead resourcePath:[NSString stringWithFormat:@"%@/SalesOrderItemDetails", [MyLogonHandler shared].data.applicationEndpointURL]];

       

        [self.batchRequestParam.batchItems addObject:requestParamSalesOrders];

        [self.batchRequestParam.batchItems addObject:requestParamSalesOrderItems];


    [self.offlineStore scheduleRequest:self.batchRequestParam delegate:self];

Now when I check for isRequestQueueEmpty, it is returning true value.

And when I try flush, the request is not reaching the gateway also.

Can anyone tell me where in my code I am doing wrong.

SDK used is SP11.

expecting your help.

Regards,

Dhani

Accepted Solutions (1)

Accepted Solutions (1)

matt_borges
Explorer
0 Kudos

Hi Dhani,

The offline store will locally execute read requests within a batch; read requests, including those in batches, do not get added to the request queue.  Only modification requests get added to the request queue (including change sets within batches).

In offline OData, only a refresh will cause a read request to be executed against the backend OData server; the refresh will send the defining requests or their associated delta links to the OData server.


Hope this helps,

Matt

Answers (1)

Answers (1)

kenichi_unnai
Advisor
Advisor
0 Kudos

>And when I try flush, the request is not reaching the gateway also.


Do you see the behavior with online store too? Or just happening with offline store?

Former Member
0 Kudos

Its happening with offline store only. The online store request reaches the gateway.