cancel
Showing results for 
Search instead for 
Did you mean: 

Deferred mode versus Non-deferred mode batch request processing? in SAP NW gateway Odata

avinashd_m
Participant

Hi All,

Can any one explain me the difference between the deferred mode batch processing(CHANGESET_BEGIN() method's changing paramter CV_DEFER_MODE set to 'X') and non-deferred mode( CV_DEFER_MODE = abap_false), and at what scenarios we usually decide to go for each of these? in SAP Odata batch request processing.

What i know till now is :

when i send a batch request with CV_DEFER_MODE set to 'X', that is deferred mode , In DPC class control follows like changeset_begin==>Changeset_process==>Changeset_end, where changeset_process internally may call basic CRUD operations of entity sets methods,

When i send a batch request with no-deferred mode, CV_DEFER_MODE set to abap_flase, in DPC class control follows like changeset_begin==>Basic Modifying methods of entity set according to the related operations in change set==>Changeset_end,

So, since in both the ways we will be calling the same modifying methods of entity set , then what actually differentiates them which makes us to go choose them for batch processing.

Thanks in advance,

Avinash

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Performance can be increased if you first retrieve the data that is going to be created and perform a mass update instead of performing several single create operations.

But also read Operations can Benefit from special handling in $batch when using the "batch at once" Option by setting the model feature use_deferred_batch_resp_crea.

avinashd_m
Participant
0 Kudos

Hi Andre,

Do you mean to say that even for read operations in batch request we can set defer mode, if yes in which class method ?

As per my knowledge, we set defer mode in changeset_begin() method, and this method will get called only for change set operations in batch request, which includes only Create,Delete and Update not any read operations, please correct me if i am wrong.

and also are you saying performance will be increased in defer mode because we will have an opportunity to write separate performant logic for the Create, Delete and Update operation inside changeset_process() method?if yes, is it the only reason for the performance improvement?

Thanks,

Avinash

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

  METHOD define.
  DATA:
    ls_model_features TYPE /iwbep/if_mgw_appl_types=>ty_s_model_features.
 
    ls_model_features-use_deferred_batch_resp_crea = abap_true.
    me->model->set_model_features( is_model_features = ls_model_features ).
  
    ...
 
  ENDMETHOD.

Sorry, I mixed it up with the model feature use_deferred_batch_resp_crea that can be set in the DEFINE method of the model provider extension class to improve request response time of OData batch requests involving similar read operations on the same entity set.

avinashd_m
Participant
0 Kudos

Hi Andre,

Thanks for "mass update" concept to improve the performance with deferred mode of changeset, Is there any other possibilities for improving the performance for deferred mode with change set operations(create,Delete and Update)?

And when do we actually go for non-deferred mode of batch processing?is it when only when i have no mass updates to do ?

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

As I said any operation that is faster when being performed in one shot should be able to gain performance.

You have however to compare this with the additioinal effort you will have implementation wise.

If you don't expect huge performance improvements you would be on the safe side if you do not leverage the deferred mode.

If this answer or any other answer has answered your question please click on "✓ Accept"

0 Kudos

Hello andre.fischer,

I have a question regarding the same topic.

We are using embedded gateway in S4HANA to expose an Odata service with multiple READ entityset to Fiori client.

When Fiori is making a call to SAP backend via $batch, there are multiple entitysets retriving data from CDS sequentially. I have checked many blogs and activated all configurations to make my Odata service allowed for Parallelization, but still it it not working. Do you think it will work if I use flag use_deferred_batch_resp_crea ?

Answers (1)

Answers (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Using the deferred mode would allow you to implement the use of content id referencing as described here by my colleagues

kenichi.unnai :

https://blogs.sap.com/2016/03/09/how-to-implement-odata-batch-processing-with-content-id-in-sap-gate...

and it can help to improve the Performance as explained by my colleague mrajasekarana in his blog

https://blogs.sap.com/2018/05/06/batch-request-in-sap-gateway/

Regards,

Andre

avinashd_m
Participant
0 Kudos

Hello Andre,

Thanks for the suggested link, i have already gone through those.

I agree content referencing is possible only in deferred mode.

In the blog i can see only that with deferred mode performance will be increased and related call stack, but i am not clear, based on what optimization happened or conditions met in the DPC class, it is been said that the performance will be increased with deferred mode?, than non-deferred mode.

Thanks,

Avinash