Hello experts,
We have created an mdk project and connected it to our backend with thousands of data. When we deployed the app in Mobile Services Client, we are encountering a sync error after a couple of minutes (gateway timeout error) because of the bulk data:

Would you know how to load big data like this? Appreciate any inputs you may have.
Thank you!
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi bing.fang,
Thanks for this, now i know where to see the retrieved data. I rerun the trace and saw that it is correctly returning the number of records. However in the display of the listpicker, there's still only one record displayed. I have not added any filter with the query options, i just specified the service and the entityset. I removed my rule first but it is still displaying a single record:

Hi bing.fang,
We have fixed the issue i just raised regarding the single record by adding some more key fields on the entityset. The question is, are we supposed to add the $top and $skip on the initializeOffline.action or where are we supposed to use it? Because when i tried to scroll down the list, it didn't load the next results.
The query options for initialize offline typically would not use $top or $skip. Most of the time you would retrieve all the records (no query options) or use a $filter to restrict based on some criteria. This action simply populates the offline db files. Then in your application when displaying a list MDK will automatically use $top and $skip to read / page the data as needed when scrolling an Object Table or List picker for example.
You can also use them in the app if needed (typically in conjunction with filters and other criteria)
Hi bill.froelich,
Is it possible for the user to always connect online and just define the specific items to be downloaded offline once he has loaded the records he wanted to use offline? As i understood from the mdk offline template, it always calls the initializeOffline.action which includes the defining requests for the selected odata entities.
Rachel,
I am not sure I fully understand your question but yes, you can add defining requests after the store is initially populated. What doesn't currently exist yet is a remove defining request option in MDK.
One approach would be to display an online list of items and allowing the user to mark the ones they then download offline for further processing. This assumes you have a backend service design that supports some kind of user selection storage and linking that when downloading the data. Having the backend handle the filtering for hte current user avoids issues with the defining requests on the client. Initially the equipment list (for example based on your screenshot) would be empty if the user has not selected equipment to download from on online lookup. Once the user selects what to download when they perform a delta sync the Equipment set would now return data since the user specified one or more items to download.
Hi bill.froelich,
Thank you so much for your response, this gives me other options to implement data fetching in our app. Regarding your first suggestion, how do we add defining requests after the store is initially populated? Currently, we have this equipment list data set in our defining request in the InitializeOffline.action, i have defined a query option for this to first get the 10,000 records. After this defining request, i wanted to call another defining request (thru custom code) that will get the next 10,000 records, then after this call another one until we get all the records.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.