cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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?

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Kevin_SAP
Advisor
Advisor
0 Kudos

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.

bob_gallo58
Participant
0 Kudos

You can also try using a post  to your OData backend using a rest client to confirm that
the OData backend is returning  the correct results for this Entity.
Most of the reasons there is a duplicate row in the offline store is the OData Backend
not returning the proper results.

Former Member
0 Kudos

Hello Bob,

Could you help me with this topic similar to this situation?

Thank you in advance.