locked
Decoupled Tombstone RRS feed

  • Question

  • Hi,
    I wonder wether the update metadata command in decoupled tracking, shouldn't also update the sync_row_is_tombstone column so that the deletes can be propagated ?
    Here is the sql code for the decoupled example:

    create procedure dbo.sp_orders_updatemetadata (
            @order_id int,
            @sync_create_peer_key int ,
            @sync_create_peer_timestamp bigint,                   
            @sync_update_peer_key int ,
            @sync_update_peer_timestamp timestamp,                       
            @sync_row_timestamp timestamp,
            @sync_check_concurrency int,
            @sync_row_count int out)       
    as           
        -- update metadta only
        update orders_tracking set
            [sync_create_peer_key] = @sync_create_peer_key,
            [sync_create_peer_timestamp] =  @sync_create_peer_timestamp,
            [sync_update_peer_key] = @sync_update_peer_key,
            [sync_update_peer_timestamp] =  @sync_update_peer_timestamp
        where order_id = @order_id and (@sync_check_concurrency = 0 or sync_row_timestamp = @sync_row_timestamp)
        set @sync_row_count = @@rowcount  
    go

    Thanks

    Alberto
    • Moved by Max Wang_1983 Friday, April 22, 2011 8:17 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, March 27, 2008 2:39 AM

Answers

  • Hi Alberto,

     

    The delete trigger does update the sync_row_is_tombstone column:

     

    CREATE TRIGGER orders_delete_trigger on orders for delete
    as
        update t   
            set sync_update_peer_key = 0,
                  sync_update_peer_timestamp = @@DBTS+1,
                  sync_row_is_tombstone = 1,
                  last_change_datetime = GetDate()
     from orders_tracking t join deleted d on t.order_id = d.order_id      
    go 

     

    Thus there is no need to do it again.

     

    Thanks

     

     

    Friday, March 28, 2008 6:49 PM

All replies

  • Hi Alberto,

     

    The delete trigger does update the sync_row_is_tombstone column:

     

    CREATE TRIGGER orders_delete_trigger on orders for delete
    as
        update t   
            set sync_update_peer_key = 0,
                  sync_update_peer_timestamp = @@DBTS+1,
                  sync_row_is_tombstone = 1,
                  last_change_datetime = GetDate()
     from orders_tracking t join deleted d on t.order_id = d.order_id      
    go 

     

    Thus there is no need to do it again.

     

    Thanks

     

     

    Friday, March 28, 2008 6:49 PM
  • Hi,
    I'm sorry I mistake, because I'm implementing a sql ce syncprovider so I have to do the trigger manually and I forgot to put it on the deletecommand of the provider the additional sql.
    Thanks and sorry


    Friday, March 28, 2008 7:51 PM