Answered by:
Sync Starts But Never Ends over WCF HTTPS

Question
-
Here's all I know, if I can get a database from the client I can begin troubleshooting:
- Sync starts and never finishes
- It is happening for multiple users
- Sync never seems to "time out" so I'm assuming the WCF service is keeping constant communications with the app
- Using Sync Service 1.0
The weird thing is that everything was working fine and then all of the sudden almost randomly this started happening to a lot of people. Could it be because I have too many people syncing at once? Please let me know if you have any ideas where I can even begin to start troubleshooting.
TravichFriday, March 5, 2010 4:28 PM
Answers
-
As you know we've talked before -- how can I get rid of what's stored in the conflict table when I continue? That info is what caused that memory leak for me.
Travich- Marked as answer by Sid Singh [MSFT]Microsoft employee Wednesday, March 24, 2010 7:04 PM
Saturday, March 6, 2010 5:30 AM -
that will be under SyncContext.GroupProgress.TablesProgress.
Here;s a code snippet on how i go about clearing it.
//assuming the conflicts had been handled on the service side // we don't need to download them anymore, so let's clear the conflict collection foreach (SyncTableProgress syncTableProgress in syncContext.GroupProgress.TablesProgress) { syncTableProgress.Conflicts.Clear(); }
- Marked as answer by Sid Singh [MSFT]Microsoft employee Wednesday, March 24, 2010 7:04 PM
Monday, March 8, 2010 3:13 PM
All replies
-
hi travich,
you can run SQL Profiler to check if there are any Sync related SQL executed in your SQL Server.
also, you may enable WCF tracing as well (http://msdn.microsoft.com/en-us/library/ms733025.aspx).
btw, the order of the tables in the designer generated code is based on the order of the tables in the Designer. By default, the tables are listed in alphabetical order in the Designer but there's an up and down arrow to change the ordering of the tables.
cheers,
junetFriday, March 5, 2010 4:44 PM -
Yeah but that absolutely does not work in a parent-child relationship I found out. If you put the parent first then the child you are fine until you try to sync deleted rows. Then you get foreign key errors. That is why I removed my relationships.
Anyways, yeah thanks, I just need to get a copy of that database and try find what's going on. Thanks.
TravichFriday, March 5, 2010 5:47 PM -
Hello travich,
Have you tried adding the tables in the reverse order?
So, if T1 has foreign key reference to T2, the correct order to add the tables to DbSyncScopeDescription object is
T2 then T1.
Hope this helps.
PatrickFriday, March 5, 2010 6:02 PM -
Right but doesn't that entail messing with the designer file? I was trying to avoid messing with the designer file -- I've already made one change I guess I could have made on more...
TravichFriday, March 5, 2010 7:40 PM -
I have a VERY big clue if someone can help -- the problem is that it's sitting there trying to apply the same failed row over and over again on a duplicate key. Here's my code:
void PowerEFSRClientSyncProvider_ApplyChangeFailed(object sender, Microsoft.Synchronization.Data.ApplyChangeFailedEventArgs e)
{
e.Action = Microsoft.Synchronization.Data.ApplyAction.RetryApplyingRow;
}
I thought this would retry ONCE not again and again. How can I just tell it to SKIP what it thinks it needs to keep applying?
TravichFriday, March 5, 2010 10:28 PM -
you can modify your event handler to check for the type of conflict (check the parameter ApplyChangeFailedEventArgs e)
the FK error will be have a conflict ype of ConflictType.ErrorsOccured (i.e., if (e.Conflict.ConflictType = ConflictType.ErrorsOccured) ), then if you dont want to do a retry, you can set e.Action = Microsoft.Synchronization.Data.ApplyAction.ContinueSaturday, March 6, 2010 2:18 AM -
As you know we've talked before -- how can I get rid of what's stored in the conflict table when I continue? That info is what caused that memory leak for me.
Travich- Marked as answer by Sid Singh [MSFT]Microsoft employee Wednesday, March 24, 2010 7:04 PM
Saturday, March 6, 2010 5:30 AM -
that will be under SyncContext.GroupProgress.TablesProgress.
Here;s a code snippet on how i go about clearing it.
//assuming the conflicts had been handled on the service side // we don't need to download them anymore, so let's clear the conflict collection foreach (SyncTableProgress syncTableProgress in syncContext.GroupProgress.TablesProgress) { syncTableProgress.Conflicts.Clear(); }
- Marked as answer by Sid Singh [MSFT]Microsoft employee Wednesday, March 24, 2010 7:04 PM
Monday, March 8, 2010 3:13 PM