duplicate keys in syncdata

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
Mariovaisman
Posts: 133
Joined: February 11th, 2013, 8:26 am

duplicate keys in syncdata

Post by Mariovaisman »

Hello,

I am working in a new round of a survey that it was a couple of years ago. At that time I used dat files (txt), and tranmitted files betwwen supervisor and enumerators. In this round I want to introduce csdb files. In the old version, after tranmission to supervisor and before concatenate, checked if there were same keys in the different files, it was not often, because the supervisor assigns the HH to an specific enumerator, and each enumerator tablet is serialized and only the assigned enumerator can open the HH, however the supervisor after the assignment and transmission to the enumerator decides to change the HH assignment to a different enumerator and transmits the assignment to the new enumerator but no to the old one, then both enumerators have the same HH in the list, then for some reason the first enumerator selects the HH and start the dataentry program and exit, it creates the case. The second enumerator complete the HH, now both send the data to the supervisor, what happen in the csdb file when both enumerators transmit to the supervisor, and both have the same HH key in their files, then if the second ovewrite the first, and the first is not accessing that wrong HH again, and then first transmit again to the supervisor other HH collected, what happen with that wrong HH, is it overwrited again?.

Would appreciate to know what happen in the explained situation, because I have a possible solution, but I need to know the behaivor of this situation.

Thanks

Mario
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: duplicate keys in syncdata

Post by josh »

In that situation I believe you will end up with duplicate cases. Whether or not cases are duplicated or overwritten in this scenario depends on which devices the cases are created on. When one case is created on enumerator A's tablet and another case is created on the enumerator B's tablet then those two cases are synced to the supervisor or to the server they will both be uploaded as separate cases. However, if you create the case on one tablet and then sync it to another tablet then even if two users modify and upload their separate copies of the case it will still be uploaded to the server as one single case and the last one to modify the case will overwrite the other version. For example, if you create the case on enumerator A's tablet and then sync it to the supervisors tablet and then sync it from there to the enumerator B's tablet, CSEntry will treat this as a single case. So if enumerator A modifies the case and enumerator B also modifies the case and then they both sync then there will be only copy of the case on the server. The system is smart enough so that if enumerator A modifies the case but enumerator does not and then they both sync, enumerator B's version of the case will be ignored since it knows that enumerator A's version of the case was updated more recently.
Mariovaisman
Posts: 133
Joined: February 11th, 2013, 8:26 am

Re: duplicate keys in syncdata

Post by Mariovaisman »

Thnak you Josh for your reply, in my application will have duplicates because those cases are indepent and created in both enumerator tablets. Then, based on your explanation, before doing the syncronization, I can identify which of both enumerators has the wrong case, means the case that couldn't be created, then will proceed to advice and then delete the wrong one before transmiting to the supervisor.

Thanks

Mario
Post Reply