Skip to Content
avatar image
Former Member

In SAP Mobile Platform (SMP) offline mode, does the data in local store get deleted whenever the app delta syncs with the server?

In SAP Mobile Platform (SMP) offline mode, does the data in local store get deleted whenever the app delta syncs with the server? So far the documentation and resources on this in the web are quite scarce. Really appreciate your kind help on this.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 12, 2016 at 06:21 AM

    When we use Offline store feature of SMP for offline usage. As part of initial download, we get below two ultralite db files.

    • Offline Entity DB i.e. <Offline Store Name>.udb
    • Request Queue DB ie.<Offine Store Name>.rq.db

    Whenever you make any CRUD operation on offline entity from Application, it will create request and get queued in request udb db.

    When you will Flush(Client to Server) Sync, all requests from request db are sent to server and during Refresh(Server to Client) sync, all the entities which are updated on Server will flow from Server to Client based on !deltaToken concept and updated your Offline Entity DB.

    Until and unless there is DELET operation performed on entities in offline store, you will not see records getting deleted from your offline store.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      With this, this means that we are able to control and trigger removal of entries in the offline store through the DELET operation is this correct? Are there any restrictions as to what data can be deleted?

  • Apr 12, 2016 at 05:53 PM

    When you do REFRESH it brings down the server row from the backend. So now the local and server rows exist in the Offline Store. Momentarily there is a duplicate row as the true version of the row from the server replaces the temporary local copy.

    There is a duplicate now in the Offline Store, but that’s expected because we haven’t performed the local row clean-up yet (post-refresh processing).

    If you use the ENTITY_ID_MAP to delete any local rows that now have a corresponding (duplicate) server row. But since the data in the ENTITY_ID_MAP is incorrect, (In this case) this is failing. The cleanup is not removing the local row and both the local and server rows remain in the store.

    Post-refresh processing( local row clean-up)

    The copy received from the server will be different from the copy on the remote. Specifically the key for the entity will be different. Lodata needs to be aware that the key is changing for this entity and update any new references to the entity to use the new key.

    NOTE: The Offline store does not verify the key properties of locally created entities.

    It is possible for an application to insert multiple entities with the same key properties locally.

    However the Offline store expects that the server will reassign keys when the entities are posted to the backend.

    There is a KBA that explains why you may see duplicate rows, 2287622, but this was an oData backend issue.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 01, 2016 at 04:43 PM

    We are in a similar scenario and we managed this situation with this work around specified in this post...

    In my opinion it is not a definitive and clean solution, any idea??

    I am posting post mentioned and with a similar scenario because in my opinion we can find a solution with different perspectives and points of view.

    Add comment
    10|10000 characters needed characters exceeded