PDA

View Full Version : What happens if/when a sync fails?



tom2014
08-26-2014, 09:14 PM
Can the CompanionLink team please explain what happens to the state of a sync if it fails or is otherwise interrupted?

I've had occasional sync challenges - aside from the SD card issue hopefully being resolved in the next software update (separate thread), through troubleshooting it seems like the next biggest challenge is when a sync is interrupted. In my case, that's usually because of what I'll generically call a "driver" issue that inconveniently arises in the middle of a sync procedure. My phone (Samsung ATIV S Neo) occasionally isn't recognized by Windows. One can find many discussions elsewhere about Samsung phone USB driver availability and issues, to include with their Android OS phones too. By retrying, or rebooting the PC or phone, etc. it does work and will come back. This isn't CompanionLink's issue of course.

However-due to the fact one must start the sync with the phone disconnected, I have no way of knowing whether it will have a problem being recognized when I do connect it in the middle of a sync, and that's where my CompanionLink challenge comes in... It seems every time this happens my new or changed records get completely messed up. They don't sync (no recognized USB connection to do so), but even when the USB connection is restored and I successfully sync the next time, what were changed records from the last session do not sync. It seems like CompanionLink thinks they synced already during the failed session and doesn't attempt again. My only solution is to open and resave (or simply recreate) all of the new/updated records so they appear changed and sync again.

This exact behavior was also one of the questions raised in a more general sync issue thread: http://www.dejaoffice.com/forums/showthread.php?3388-Sync-is-not-reliable


... One thing I'll add is that sometimes, though a small percentage of times, I noticed Windows wouldn't recognize the device either. Obviously sync wouldn't work then and of course I don't blame Deja for that. I'd get unable to connect to the windows phone or something like that from Deja as an error message. I'd have to cancel the sync, disconnect the cable, start again, plug in the cable, and hope it was picked up, if not repeat. Sometimes I'd reboot the PC and phone too. I'm afraid that that partial / failed sync may have marked the records as synced and thus when it finally went they wouldn't sync because Deja thought they had already....

So my question to CompanionLink is can you please elaborate on the interrupted/failed sync scenario, i.e. does the Deja database sync session have atomicity such that if interrupted everything is backed out? Will CompanionLink automatically recover next time? Is there a certain cancellation procedure that must be used? Or does an interruption of a USB sync cause these types of data consistency problems?

Thank you

DJOCTO
08-28-2014, 12:56 PM
Tom, given these problems with the native USB system, I would highly recommend the DejaCloud system. This frees you from worrying about drivers or USB compatibility.

tom2014
08-28-2014, 05:42 PM
Tom, given these problems with the native USB system, I would highly recommend the DejaCloud system. This frees you from worrying about drivers or USB compatibility.

Wayland, thanks for the reply.

I appreciate you trying to remove a variable to my success using the product, but I do want to use the USB sync. In fact, CompanionLink's support for a local USB sync option was my number one reason why I chose it over a competing product.

I understand there are some driver issues with the phone(s) and USB connections in general in my experience are sometimes temperamental--but the USB sync generally works for me.

I'm just trying to understand better what happens when it doesn't... By "problems with the native USB" system, do you mean an interrupted sync session will cause problems for CompanionLink as described? If so, it helps explain what's going on, and hopefully I can mitigate it if you have any tips... If that isn't the cause, then I have some other problem whereby records occasionally don't appear to sync properly that will require further investigation.

Thanks,
Tom

DJOCTO
09-05-2014, 11:12 AM
I referred an issue up to the programmer with regard to your original post.

With Android, we have engineered USB sync three different times. There have been considerable obstacles, mostly that Google didn't design the phone to even be connected. The USB methods are:

1. USB MSM Mode - PC opens the Phone as a Mass Storage Device, accesses the data using SQLite to read and write data.
2. USB ADB Mode - Froyo and higher allowed us to open a Serial connection to the device to sync to it. This is now all but obsolete on Ice Cream Sandwich and higher devices
3. USB MTP Mode - Uses Music Transfer protocol to move the entire data file to the PC, Syncs to it, Then moves it back.

In your case, I think it is the MTP mode sync, in the case of a failure, does not move the file back to the phone. The PC knows the data is written, because it was. It just never got back to the phone.

I send this to the developer to see what we can do. The obvious thing is to not commit the changes until after we know the MPT connection go the file back to the phone.

I'm sorry for the inconvenience.

tom2014
09-07-2014, 07:34 PM
I referred an issue up to the programmer with regard to your original post.

Thank you Wayland.


With Android, we have engineered USB sync three different times ... In your case, I think it is the MTP mode sync, in the case of a failure, does not move the file back to the phone. The PC knows the data is written, because it was. It just never got back to the phone.

I send this to the developer to see what we can do. The obvious thing is to not commit the changes until after we know the MPT connection go the file back to the phone.

I'm sorry for the inconvenience.

Given that this is Windows Phone, was the development history for Android just an example? Is MTP mode sync what is being used for Windows Phone as well?

Thanks for the explanation of how the MTP sync works. Assuming that is what Windows Phone is doing, I can see how they would get out of sync if the sync were interrupted before the file got back to the phone, and also that it would impact the entire batch of changes as it is sending an entire file, not individual changes/records, so that helps me understand what the impact would be. Please let me know what the developer's opinions are when they get back to you. Thanks.

DJOCTO
09-14-2014, 08:13 AM
This is now fixed for DejaOffice Android. Please download CompanionLink Beta from here:

http://www.companionlink.com/inhouse/

The fix is that if a sync fails with MTP mode.

You are right, you posted this in Windows Phone. I totally missed that part of the equation. I'll check to see whether a further fix is available for Windows Phone.

Windows Phone USB is frigging amazing, so I hope you are amazed. Microsoft worked very hard to make it impossible. It took us 9 months to figure out a way around all their blocks.