cancel
Showing results for 
Search instead for 
Did you mean: 

Refreshing schema model in a Offline Kapsel application

Former Member
0 Kudos

Hello,

I am working with a Offline application using Kapsel Odata plugin. Currently we have the version 1.1 of our app but the next version 1.2  will include changes in the schema model of the database. Concretely I am adding two boolean fields in our API.

With a clean installation of the newest version of our application works correctly, but when I update from the 1.1 to the 1.2 it is not working and the values are not added or updated.

Why is not updating correctly the schema and values?

I have seen this link: Offline OData Refreshes and Updates - Application Development in SAP Mobile Platform - SAP Library reading the area of Schema upgrades, is it necessary to send anything from the Odata producer to the front-end to detect changes in the schema?

Thank you for your help.

Óscar

Accepted Solutions (1)

Accepted Solutions (1)

rakshit_doshi
Active Contributor
0 Kudos

Hi Oscar,

You cannot update the offline store schema once its made at initial. Even if you want to add another Entity Set after its downloaded its not possible. A new version of app with a new or changed schema will require you to create a new offline store.

Hope this helps,

thanks,

Rakshit Doshi

Former Member
0 Kudos

Thank you for your useful response..

I thought it would be possible to upload schemas in the database with new fields etc... (than I do not understand correctly the documentation in the link added in my post)

...so do you know how to create a new offline store destroying the previous one? maybe any method in the kapsel odata plugin?

Regards,

Óscar.

rakshit_doshi
Active Contributor
0 Kudos

Hi Oscar,

You can do something like get the instance of the offline store

store = sap.OData.stores[0]; or can initialize the store again with

store = sap.OData.createOfflineStore(properties); which will do nothing but open the store.

Then you can call store.clear(successCallback, ErrorCallback, "Name of offline store") which will delete the offline store.

Hope this helps,

Thanks,

Rakshit Doshi

Former Member
0 Kudos

And one more question, What do you mean the information shown in the "schema upgrades" inside of this link?

Offline OData Refreshes and Updates - Application Development in SAP Mobile Platform - SAP Library

In my opinion it looks like is possible... but there I have the confusion with this part/topic.

rakshit_doshi
Active Contributor
0 Kudos

Hi Oscar,

This is an updated link. I was not aware of this feature that SMP is doing manually. If it is doing automatically of deleting old store and downloading new store when you add entities then i suppose your purpose is solved. but if you are replacing any entities this wnt work. for that you will have to use the above approach.

Anyways its worth a shot.

Hope this all helps.

Kindly mark answers as complete or helpful and close the discussion if the issue is solved.

Thanks,

Rakshit Doshi

Former Member
0 Kudos

By the way, do you know if it is possible to detect changes in between versions of the model of the database?

Scenario would be:

-Detect changes in the model and depending if we have changes or not to clear database or not..

Any comment for this scenario shown at the beginning of the post will be highly appreciated

Former Member
0 Kudos

To my knowledge there is not any versioning built into the metadata/model which can be used for this.  We've discussed (but not implemented) how we might do this, and I think we would read the "db version" from one of the entity sets, then possibly use that version as part of the offline store name?  Might be an option.  Or you could store the db version in local storage/encrypted storage for comparison.

I would agree from my experience that field level adds usually seem to work automatically, while you cannot add/remove entities in the offline defining request without creating a new offline store.

Former Member
0 Kudos

Definitely our url specified in the defining request was different and it is not possible to modify defining request adding entities without clear stores.


One more question Dan Antonio, do you know if it is possible to add new "defining requests" to the ini file no removing the old stores? and change the name of the defining request?

Thank you for your helpful response.

Óscar

Former Member
0 Kudos

So far, I believe any change to the defining request requires a removal/recreation of the offline store to take effect.

Former Member
0 Kudos

Don´t you think is very confuse this link, concretely in the "schema upgrades" chapter?

http://help.sap.com/saphelp_smp3012sdk/helpdata/en/59/ae11dc4df345bc8073f9da45170706/content.htm

If it is not possible to add entities to the defining request store, documentation should be modified, right?

Regards.

Óscar

Answers (0)