سؤال

On my SQL Server I have change tracking enabled, auto cleanup set to false or to true with a very high retention period like 364 days.

Using Microsoft Sync Framework I sync the first time successfully, the second time I try to sync I get the error

"System.Data.SqlClient.SqlException (0x80131904): SQL Server Change Tracking has cleaned up tracking information for table 'TableName'. To recover from this error, the client must reinitialize its local database and try again".

Why is the tracking information being cleaned although the auto clean up is set to false?

I tried the solution posted by this article, but it did not work for me, when I run the reinitialize code it takes forever and the RAM usage keeps building until I get out of memory exception.

Please note that my database is big, over 400 MB, the total number of records synced is over 163,000 record, the first sync takes a long time so resorting to deleting the local CE database when this error happens is not an option.

هل كانت مفيدة؟

المحلول

I discovered that the problem occurs when I restore the server database from backup and before any change has happened on the database.

So the simple solution was that after I restore the database from backup I just go and update any column of any row in any tracked table and that fixes the problem!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top