Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
kenichi_unnai
Advisor
Advisor
0 Kudos

Hi everyone, time to code.


In order to refresh the offline store...

This single line of code does the job.

01  [offlineStore scheduleRefreshWithDelegate:self];

Just like the other delegates so far, we need a new delegate named SODataOfflineStoreRefreshDelegate. In this example it is declared in the same class, so simply set self. This delegate has two mandatory callback methods:

  • offlineStoreRefreshSucceeded: Called when a refresh has finished successfully.
  • offlineStoreRefreshFailed: Called when a refresh has failed.

And two optional callback methods:

  • offlineStoreRefreshStarted: Called when a refresh has started.
  • offlineStoreRefreshFinished: Called when a refresh has finished.

That's all for the refresh. How about the flush?

01  [offlineStore scheduleFlushQueuedRequestsWithDelegate:self];

Yes we have a delegate for this too. It is SODataOfflineStoreFlushDelegate (yes, your wild guess is correct 🙂 ). It has two mandatory callback methods:

  • offlineStoreFlushSucceeded: Called when a flush has finished successfully.
  • offlineStoreFlushFailed: Called when a flush has failed.

And two optional callback methods:

  • offlineStoreFlushStarted: Called when a flush has started.
  • offlineStoreFlushFinished: Called when a flush has finished.

...Hope you're pleasantly surprised with its simplicity.

However...


Yes, I hear you. The question is "What if the OData Producer fails one of the queued requests during a flush?"


We'll discuss about it in the next one, stay tuned.



See you in the next blog,

Ken


List of blogs

2 Comments