on 2012 Apr 18 2:38 AM
Hi All,
I am developing an iPad application. My dev environment set up is like
I have implemented the synchronization model successfully. I have three different publications to synchronize. All are working fine. But if somehow any synchronization failed due to any issue either WIFI connectivity or if already have an open connection from Sybase Central tool. After this failure synchronization won't success for that particular ml-remote-id, no matter how many times i try. I am getting this errors:
Sync failed: -1305 (MOBILINK_COMMUNICATIONS_ERROR) %1:8 %2:7 %3:0
If i try again by changing ml-remote-id same publication will run successfully.
I am stuck with this issue. Please help.
Hi Guys, Thanks a lot to all, especially to Yufei. This got solved too.
I just ran the ml_reset_sync_state SP on server for remote id = 705 and it worked. But here is an observation i would like to share:
1. As Graham mentioned that after wiping the DB file you need to reset the remote id otherwise it will lead to Sync failure, but i have tested this many times and sync will run successfully with same remote id even if i am deleting it from the App Sandbox.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. Your observation is right, because the MobiLink server will always accept the initial sync after the remote database is rebuilt.
@Yufei: Thanks for reminding me that special handling of initial syncs had been added in an earlier version (I think it was version 10)!
@Gandalf: You probably saw the problem only after an initial sync failed after sending its upload, eg. because of a network error. In that case, the next sync could check the progress, so my advice still holds unless you can be certain that the first sync after remote reset won't fail.
Here's another point which may not apply but is still important 🙂
As of iOS 5.0.1, you should set the "do not backup" attribute on the database file (see Technical Q&A QA1719).
You should also specify the temp_dir connection parameter with the path to the app's tmp directory (use NSTemporaryDirectory()), so UltraLite's temporary file is not placed in the Documents directory. (By default, the temp file goes beside the database file.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure this totally fits, but I'll offer it anyway. When you first synchronize an UltraLite database it automatically takes on a unique remote-id (it generates a UUID to do this, and stores it in the database). The server relies on each remote database having a unique remote-id. If you copy a synchronized database, and subsequently continue synchronizing both copies, the uniqueness requirement will not be met and you will likely encounter errors. (The server log should clearly diagnose this issue.) So, the rule is if you copy a database you must clear the copy's remote-id before synchronizing it. This is done by executing 'SET OPTION ml_remote_id='.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The uniqueness requirement is not just for a given point in time; there should only be one "sync progress" (or offset) for a remote ID. If you are wiping the remote DB file, and want to re-use a previously used remote ID, you have run the ml_reset_sync_state stored procedure in the consolidated database. Instead, you should not re-use a remote ID when a remote database is recreated - it's a different database after all.
As Yufei has clarified, the MobiLink server automatically resets the progress for a previously-used remote ID if it's the first sync since the remote database was created. However if that first sync fails after sending its upload and before the MobiLink server commits its automatic progress reset, the next sync from that remote will fail.
Update: In looking back, many holes in the progress checking logic have been filled over the years, so your problem should not be common. I suspect that it may be a case that only happens when using UltraLite remotes with multiple publications that have differing offsets, and following a failed initial sync with a re-used remote ID.
It's best to leave the remote ID alone. If you have been using it for data partitioning or business logic, instead use either the MobiLink user or an authentication parameter.
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.