none
How to avoid DeleteCommand call from DbSyncAdapter in SyncDirectionOrder.DownloadAndUpload RRS feed

  • Question

  • Hi All,

    In my application, we are calling the stored procedure for deleting data from a table. But we are not deleting any records as per the requirement. But still this DeleteCommand is called. and getting the below error(#1).
    I tried to remove the DeleteCommand fro the DbSyncAdapter, but then I am getting another error(#2).

    Can anyone guide me, how can I remove this DeleteCommand  call from DbSyncAdapter, for each tables?

    Error #1)

    VERBOSE, w3wp, 57, 02/02/2018 07:18:34:816,    RowId: questioncurrversion-217 UV: 277,1807 CV: 277,3062 IsTomb: True
    VERBOSE, w3wp, 57, 02/02/2018 07:18:34:816,    Deleting row with PK: QuestionVersionId="217"  on 
    VERBOSE, w3wp, 57, 02/02/2018 07:18:34:816,    Executing Command: sp_QuesCurrVer_applydelete
    VERBOSE, w3wp, 57, 02/02/2018 07:18:34:816,       Parameter: QuestionVersionId Value: 217
    VERBOSE, w3wp, 57, 02/02/2018 07:18:34:816,       Parameter: sync_min_timestamp Value: 4860642
    VERBOSE, w3wp, 57, 02/02/2018 07:18:34:816,       Parameter: sync_row_count Value: Skipped since Not Input/InputOutput
    VERBOSE, w3wp, 57, 02/02/2018 07:18:34:816,       Parameter: sync_force_write Value: 0
    VERBOSE, w3wp, 57, 02/02/2018 07:18:34:816,    Rows affected: 0
    ERROR  , w3wp, 57, 02/02/2018 07:18:34:816, Caught Exception while executing SelectRowCommand
    Microsoft.Synchronization.Data.DbSyncException: Cannot find a value to set for command parameter 'p_QuestionVersionId'. Ensure that the schemas of the tables being synchronized are consistent, and that the configuration for this scope is correct.
       at Microsoft.Synchronization.Data.DbChangeHandler.SetColumnParameters(IDbCommand command, SyncRowMetadata rowMetadata)
       at Microsoft.Synchronization.Data.DbChangeHandler.ExecuteSelectRowCommand(SyncRowMetadata rowMetadata, DataTable& dataTable)
    ERROR  , w3wp, 57, 02/02/2018 07:18:34:816, Caught exception while applying changes: Microsoft.Synchronization.Data.DbSyncException: Cannot find a value to set for command parameter 'p_QuestionVersionId'. Ensure that the schemas of the tables being synchronized are consistent, and that the configuration for this scope is correct.
       at Microsoft.Synchronization.Data.DbChangeHandler.SetColumnParameters(IDbCommand command, SyncRowMetadata rowMetadata)
       at Microsoft.Synchronization.Data.DbChangeHandler.ExecuteSelectRowCommand(SyncRowMetadata rowMetadata, DataTable& dataTable)
       at Microsoft.Synchronization.Data.DbChangeHandler.ApplyDelete(FailedDeleteDelegate_type failedDeleteDelegate)
       at Microsoft.Synchronization.Data.ChangeHandlerBase.ApplyChange(FailedDeleteDelegate_type failedDeleteDelegate)
       at Microsoft.Synchronization.Data.RelationalSyncProvider.ApplyChangesInternal(DbSyncScopeMetadata scopeMetadata, IDbTransaction transaction, FailedDeleteDelegate_type failedDeleteDelegate, DataSet dataSet, ChangeApplicationType applyType)
       at Microsoft.Synchronization.Data.RelationalSyncProvider.ApplyChanges(DbSyncScopeMetadata scopeMetadata, IDbTransaction applyTransaction, DataSet dataSet, DbSyncSession DbSyncSession, Boolean commitTransaction, FailedDeleteDelegate_type failedDeleteDelegate, String batchFileName, ChangeApplicationAction& action)
    ERROR  , w3wp, 57, 02/02/2018 07:18:34:816, Rolling back application transaction.
    VERBOSE, w3wp, 57, 02/02/2018 07:18:34:816, Closing Connection
    INFO   , w3wp, 57, 02/02/2018 07:18:58:052,    EndSession() called on Provider ServerDbSyncProvider, CCRL.LIP.SyncLibrary, Version=4.12.0.0, Culture=neutral, PublicKeyToken=null


    Error #2)

     The adapter for table 'QUESTIONCURRVERSION' does not have the required command 'DeleteCommand' specified.


    Thursday, February 8, 2018 11:56 AM