none
MSSQL->SQLCE Change Tracking Error RRS feed

  • Question

  • I am getting the following stack trace when running a sync app between a SQL2008 and SQLCE application

    2010-03-10 10:55:17,665 [1] FATAL SyncTest.Program [(null)] - The specified change tracking operation is not supported.
    To carry out this operation on the table, disable the change tracking on the table, and enable the change tracking.
    System.InvalidOperationException: The specified change tracking operation is not supported. To carry out this operation
    on the table, disable the change tracking on the table, and enable the change tracking.
       at System.Data.SqlServerCe.SqlCeChangeTracking.ProcessResults(Int32 hr)
       at System.Data.SqlServerCe.SqlCeChangeTracking.VersionCheck(TrackingVersion& iCurrentVersion, TrackingVersion tSuppor
    tedVersion, TrackingVersion tUnsupportedVersion)
       at System.Data.SqlServerCe.SqlCeChangeTracking.GetTrackingType(String tableName)
       at Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider.GetTableRowKey(SqlCeCommand cmdUtil, String tab
    leName, Boolean& fRowGuidFound)
       at Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider.CreateOcsTable(String fmtTableName, Boolean cre
    ateTable, SyncTable syncTable, SyncSchema syncSchema, SqlCeCommand cmdUtil)
       at Microsoft.Synchronization.Data.SqlServerCe.SqlCeClientSyncProvider.CreateSchema(SyncTable syncTable, SyncSchema sy
    ncSchema)
       at Microsoft.Synchronization.SyncAgent.InitClientSchema()
       at Microsoft.Synchronization.SyncAgent.DataSynchronize()
       at Microsoft.Synchronization.SyncAgent.Synchronize()
    The strange thing is, it works perfectly on my dev machine ( Windows 7 / VS2010 ), but not on the server (W2003)

    I have the 3.5sp2beta2 SQLCE bits installed on both, and I have included the dependency DLLs in the bin folder.  I suspect a versioning issue, but am running out of things to try.

    I would like to try the recommendation to disable/enable change tracking, but it looks like this documentation for this is not ready yet (google/bing failed me).

    Any suggestions?

    Wednesday, March 10, 2010 4:39 PM

Answers

All replies

  • have you tried looking for SqlCeChangeTracking in the beta API. I think there's a way to disable it using the API.
    Wednesday, March 10, 2010 4:58 PM
    Moderator
  • Hi,

    June is right. With SQLCE 3.5 SP2, CE change tracking related APIs are exposed as public methods. You can find EnableTracking and DisableTracking methods in SqlCeChangeTracking class. When you first time connect the existing SQLCE 3.5 SP1 database with SP2 CE engine and that database has change tracking enabled already, you need to disable and re-enable change tracking for it to switch to new tracking logics.

    Thanks,
    Dong
    This posting is provided AS IS with no warranties, and confers no rights.
    Wednesday, March 10, 2010 6:34 PM
    Moderator
  • I have tried to disable and re-enable change tracking, but I keep getting the same error: The specified change tracking operation is not supported.
    To carry out this operation on the table, disable the change tracking on the table, and enable the change tracking.
    System.InvalidOperationException: The specified change tracking operation is not supported. To carry out this operation
    on the table, disable the change tracking on the table, and enable the change tracking.

    Another thing that I don't understand is tat UpgradePublicTracking always return True. This is my code:

    SqlCeClientSyncProvider provider = (SqlCeClientSyncProvider)syncAgent.LocalProvider;
    if (SqlCeChangeTracking.UpgradePublicTracking(provider.ConnectionString))
    {
        SqlCeConnection connection = new SqlCeConnection(provider.ConnectionString);
        connection.Open();

        using (SqlCeChangeTracking changeTracking = new SqlCeChangeTracking(connection))
        {
            foreach (var syncTable in syncAgent.Configuration.SyncTables)
            {
                changeTracking.DisableTracking(syncTable.TableName);
                changeTracking.EnableTracking(syncTable.TableName, TrackingKeyType.PrimaryKey, TrackingOptions.All);
            }
        }
    }

    I have Guid as keys in all tables that is part of synchronization and I have one table that is only used in the client. Any help would be appriciated.


    Eric Quist
    Thursday, May 27, 2010 4:30 AM
  • have you tried updating to Sync Fx V1 SP1?
    Thursday, May 27, 2010 7:50 AM
    Moderator
  • I am using Visual Studio 2010 and the referenced assemblies are:

    • Microsoft.Synchronization v2.0
    • Microsoft.Synchronization.Data v3.0
    • Microsoft.Synchronization.Data.SqlCe v3.0
    • Microsoft.Synchronization.Data.Server v3.0
    • Microsoft.Synchronization.Data.SqlServer v3.0

    Thanks for your fast reply. I'm been out-of office without possibility to reply.


    Eric Quist
    Saturday, May 29, 2010 4:48 AM
  • not sure if its the same issue with connections here: http://social.microsoft.com/Forums/en-US/syncdevdiscussions/thread/3bbf9900-f0f8-4c8b-b6cd-4158c682fe62

    but can you try, disabling tracking, closing the connection, opening a new one, enabling tracking, closing connection again.

    Monday, May 31, 2010 12:23 PM
    Moderator