Folks, Just in case anyone is here that is not subscribed to synce-users, this has to be read to be believed. It is a copy of the message I sent there a moment ago:
---- Remember the problem some of you have had with WM6 when deleting a partnership all the PIM items disappear with it? Well I have finally got to the bottom of this now - and guess what? We are stuck with it! That's right, it's a FEATURE, not a bug (either in our code or in WM6)!!!!! Can you believe this! I didn't believe any software developer could be this daft at first, until I remembered I was dealing with a Microsoft product. It happens with ActiveSync on Windows too. A little more info for those who are interested: Initially when being appraised of this problem, I spent a good few hours analyzing wire dumps between AS and the device under Windows. Deleting and recreating partnerships many times, I could not make PIM items disappear. The wire dumps showed that our sync-engine code was, in fact, operating correctly in that it was processing the partnership deletion in the same way as ActiveSync. However, on the Linux box it happened predictably. Initially I was seeing sync-engine crash and naturally I assumed that the two problems were related. A few hours later and the crash problem was largely fixed (it seems to work more reliably if the partnership is not bound before being deleted). However PIM items continued to be deleted with the partnership. And then, when examining the setup to see what was different between the AS on Windows and the sync-engine setups, it struck me that when testing sync-engine, I had just one partnership on the device. I was deleting this leaving no partnerships and recreating just the one. When testing with Windows, I created a second partnership _leaving the sync-engine one intact_. So I deleted all partnerships from the device, restored the PIM items, then created just one partnership under Windows, just syncing tasks. Then I deleted it. Guess what? All the tasks disappeared. Same happened when I tried to sync contacts, same with calendar, same with all three. Turns out the way it works is as follows ---------------------------------------- When WM6 creates the partnership, it creates an association between the actual PIM data and the partnership. Now, if you create a second partnership, syncing the same items, a second association is created between the same PIM data and the second partnership. Now this works a bit like a reference count. You can safely delete/recreate/delete the second partnership and nothing will disappear, because the first partnership holds a reference to the PIM items. You can also delete the first partnership safely providing the second partnership is still present. Ok so far. Now delete one partnership, then delete the second one. Upon deletion of the second partnership there are no more partnerships available associated with the PIM items :- so WM6 DELETES THE PIM ITEMS! Under Windows, it even tells you it is going to do this with the following message, displayed in a message box with an 'Ok' button: "Deleting the synchronization relationship with the PocketPC will remove all the E-mail, Calendar, Contacts and Tasks information on your PocketPC that is synchronized only with this computer the next time the device is connected. To synchronize this PocketPC with this computer again, you must set up a new synchronization relationship" I guess M$ see this as a 'security feature' or something like that! So at this point I thought I had better go on a trawl and see if anybody in the Windows community had seen this problem. Didn't take long before I found this thread: http://forum.soft32.com/pda/Removing-partnership-losing-data-ftopict79766.html Furthermore, if you have one partnership that syncs, say Contacts and Calendar, and the second that only syncs Tasks, if you delete the second partnership you will lose all your Tasks (there is only one partnership that holds a reference to Tasks) and if you delete the first, you will lose all your Contacts and Events (only this partnership holds a reference to Contacts and Events). Basically this is an exclusive operation, so you will only lose the item type for which you are deleting a partnership that holds the only reference - if another partnership holds a reference to this item type you will not lose it. I'm going for some coffee now, I bloody need it after discovering this behaviour! John. ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ SynCE-Devel mailing list SynCE-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synce-devel