none
Exception in Custom DbSyncProvider for Mysql Synchronization: "Value cannot be null. Parameter name: replicaId"

    Question

  • Hi, I am trying to sync a bidirectional MySql DB using sync framework(so few syncs about mysql? I only found some examples about oracle or firebird which helps little).

    When doing the synchronization it always said "ReplicaId cannot be null" as shown below:

    VERBOSE, OPSystem.vshost, 9, 07/11/2014 03:30:29:277,    Executing Command: db_opsSync.sp_GetTimeStamp
    VERBOSE, OPSystem.vshost, 9, 07/11/2014 03:30:29:278,       Parameter: @sync_new_timestamp Value: Skipped since Not Input/InputOutput
    VERBOSE, OPSystem.vshost, 9, 07/11/2014 03:30:29:337,    Executing Command: SELECT scope_id, scope_local_id, scope_sync_knowledge, scope_tombstone_cleanup_knowledge, scope_timestamp FROM db_opsSync.ScopeInfo WHERE scope_name = @sync_scope_name
    VERBOSE, OPSystem.vshost, 9, 07/11/2014 03:30:29:338,       Parameter: @sync_scope_name Len: 8 Value: customer
    ERROR  , OPSystem.vshost, 9, 07/11/2014 03:30:29:507, Caught exception while getting changes: System.ArgumentNullException: Value cannot be null.
    Parameter name: replicaId
       at Microsoft.Synchronization.SyncIdFormat.ValidateArgument(SyncId id, String argumentName, String errorMessage)
       at Microsoft.Synchronization.SyncKnowledge..ctor(SyncIdFormatGroup idFormats, SyncId replicaId, UInt64 tickCount)
       at Microsoft.Synchronization.Data.SyncScopeHandlerBase.GetCurrentKnowledge()
       at Microsoft.Synchronization.Data.DbSyncScopeHandler.ReadScope(IDbConnection connection, IDbTransaction transaction, ReadKnowledgeType readType, ReadForgottenKnowledgeType readFKtype)
       at Microsoft.Synchronization.Data.SyncScopeHandlerBase.ReadScope(IDbTransaction transaction, ReadKnowledgeType readType, ReadForgottenKnowledgeType readFKtype)
       at Microsoft.Synchronization.Data.RelationalSyncProvider.GetChanges(DbSyncScopeMetadata scopeMetadata, DbSyncSession DbSyncSession, UInt32 memoryBatchSize)
    ERROR  , OPSystem.vshost, 9, 07/11/2014 03:30:29:563, Disposing of transaction

    The scope table is :

    CREATE TABLE db_opsSync.ScopeInfo(
        scope_local_id int NOT NULL AUTO_INCREMENT UNIQUE ,  
        scope_id char(36), -- for MySqlDbType.Guid, VARBINARY(16) UNIQUE cannot work either!  
        scope_name varchar(100) NOT NULL PRIMARY KEY,
        scope_sync_knowledge varbinary(10000) null, -- for MySqlDbType.VarBinary ,
        scope_tombstone_cleanup_knowledge varbinary(10000) null, -- varbinary(max) NULL,
        scope_timestamp Timestamp,
        scope_cleanup_timestamp bigint  -- bigint
    );

    Anyone knows about the reasons? Thanks in advance...



    • Edited by jun26 Friday, July 11, 2014 6:38 AM
    Friday, July 11, 2014 3:51 AM

Answers