Getting Stuck in GetChanges

Jan 28, 2015 at 1:11 PM
Hello, we are using this great tool (really conpliment) to sync a quite big database.

To do so we are using a Default scope and a Template scope but sometimes the Synch process get stuck in GetChanges stage and never goes to DownloadingChanges.

It is strange because other times the synch just goes straight and smooth with no problem (and very fast as well) specially after having provisioned but if I delete the local db and restart a sync in order to re download a database sometimes I the client get stuck in getchanges and does not move.

Does somebody have experience of this as well?
It is not surelly the syze of the db (around 50 mb) and this is happening specially with Template scopes (while with a default scope even if the data are 180 mb it does not happen often).

If someone had the same problem I would love to hear from them.

Feb 4, 2015 at 8:21 AM
Can you share your sample, to be able to reproduce this strange behaviour ?
Feb 6, 2015 at 10:05 AM
Hello, yes if you tell me what you need I will try to provide you everything.

In the main time I can maybe give you more details as I have turned on the tracking on the server sid.

Some times (but not always) when this problem happens I have in the log of the server side this exception:
ERROR  , w3wp, 14, 02/01/2015 12:26:06:756, Caught exception while getting changes: Microsoft.Synchronization.Data.DbSyncException: Cannot enumerate changes at the RelationalSyncProvider for table 'SFM_ECC_ORDERS'.  Check the inner exception for any store-specific errors. ---> System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out
   --- End of inner exception stack trace ---
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
   at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
   at System.Data.SqlClient.SqlDataReader.Read()
   at Microsoft.Synchronization.Data.RelationalSyncProvider.EnumerateChangesInBatchesInternal(Object batchProducer)
   --- End of inner exception stack trace ---
   at Microsoft.Synchronization.Data.DbSyncBatchProducer.DequeueBatch()
   at Microsoft.Synchronization.Data.RelationalSyncProvider.ConsumeBatchFromProducer(DbSyncScopeMetadata scopeMetadata)
   at Microsoft.Synchronization.Data.RelationalSyncProvider.GetChanges(DbSyncScopeMetadata scopeMetadata, DbSyncSession DbSyncSession, UInt32 memoryBatchSize)
I thought it was the reason of getting stuck on getchanges stage so I have looked around on the internet and I found I had to increase the commandTimeOut of the server side and so I did (3600 seconds).

I still get the error sometimes (very strange SF_ECC_ORDERS is a very big table for me surelly it does not take 1 hr to run the selectchanges query) but it does not look like being the reasong of the problem as sometimes I do not get in the log the exception but still the ui get stuck to getchanges

The server calculate everything but when it finishes it is like the client is not listening anymore to download.

I have at the moment put a work around for it.

I know that usually to get to download with that particular territory takes around 2 minutes so I have put a timer if after 2 minutes I am still on getchanges stage I end the sync session and I restart. Doing that the server starts to send me the changes and the sync complete 100% sucessfully (And this is ture always).

The db I am downloading is not big for that scope (around 50 MB I know the synch framework can do much more as I am synching another scope that download 200Mb with no problem at all but this scope does not have that particular big fat table).

If you let me know what you need more to understand better I can give youi what you ask for.

Thanks very much for your help and for your great work (really it is amazing:))