Synchronization

1
Hi, I'm trying to gain some insight into the synchronization process. We have an inspection app, 1 model with a desktop bit and an offline tablet bit that runs on an iPad. So there's one shared central database. Inspections that are made offline will have to be synced from an iPad to the central database. However, we've been running into synchronization issues like timeouts and uncompleted syncs.  I know that: - Syncing is done at startup automatically - Syncing can be done when triggering the save button  - Syncing can be done manually by using the default button And it checks for an active internet connection in all cases.   My question: How does that syncing process work? I think specifically, how does my local database interact with the central database? On the tablet, we basically only have the options to create an inspection (with pictures) and a 'My Inspections' page where you can view all of your own inspections. So when it starts, does it sync the entire central database? And would it be possible to manipulate the syncing process, should it be the case that it syncs the entire central database?   A lot of questions, I'm trying to clarify the process so I can pinpoint the root cause of some problems we're having :)  Any help is very much appreciated, many thanks! Kind regards, Laxmi
asked
3 answers
2

The synchronization process will sync any data that the user has access to that appears on pages in the offline navigation. Entities that do not appear in your offline pages will not be synchronized. The sync does detect reference selectors.

The synchronization does not take into account any database selection criteria on your pages, like in any listviews.

You could restrict the amount of data being synchronized by limiting the entity access. For example, when the inspection is completed, no longer allow the tablet user access to it by adding an XPath constraint to your entity access, specifying the inspection status.

Also make sure that users are only allowed their own inspections, assuming that is applicable for your app. Otherwise, all inspections from all users would be synchronized. 

In other words, restrict access to the data being synchronized as much as possible using entity access.

answered
0

Hi Laxmi,

As Marcel wrote, the current approach to limit the amount of data is indeed via entity access. We do want to make this more flexible/configurable. There are two main options:

- Create a separate domain model for the offline app so that only that data is synchronized

- Add an attribute to the entities thats states whether the entity should be synchronized. You can hook into the synchronization mechanism on the Hybrid app. This does require custom JavaScript.

btw, regarding: "Syncing is done at startup automatically" This was the case before (7.8, don't remember the exact version). Now the data is only synchronized at startup after a model update.

answered
0

Hi Danny, Marcel,

Thanks for your input! :) You definitely helped us! 

 

 

answered