I'm getting this error but I can't figure out exactly which table is getting the conflict. As I understand, going by what the documentation and the error itself tells, this occurs when a record is changed both by the download phase and a local update. I have some suspect tables, but I wonder if there is a way to see exactly in which table the conflict has occurred?
Since it is a client error, it doesn't appear in the server logs no matter what the verbosity level is.
asked 23 Oct '12, 18:23
As you know, this (SQLE_DOWNLOAD_CONFLICT) can only happen when you have modified rows locally after a synchronization started.
You should be able to figure out the table in question using the synchronization observer callback function. It will tell you what table is synchronizing and the last one reported before the error is what you're looking for. (You should be able to also confirm by disabling the code which does the concurrent modifications...)
See the documentation (or ulcpp.h) for ul_cpp_error_callback_fn and ULDatabaseManager::SetErrorCallback(). (Note that in the callback function you can't call UltraLite APIs and should not do any long or blocking operations. NSLog is probably a good thing to do - for development :)
Also note that this error says the synchronization download was rolled back, but it isn't really a "bad" error. Background synchronization was designed to work this way: your changes are uploaded and if the download doesn't conflict with the other things you have going on, it will be applied. If it does conflict, no worries, it backs off and will try again on the subsequent sync (after your conflicting changes have been uploaded for proper conflict handling on the server).
(On the other hand, if your local changes occur after the download has modified the rows, you will get an error on your attempt to modify. In this case by default the sync "wins" (though you could cancel the synchronization from the observer callback if that made sense). You must then redo your modifications after the sync has completed.)
answered 24 Oct '12, 12:28