Custom Triggers and Sync Framework RRS feed

  • Question

  • Hello,

    My question is fairly straightforward: I am using a SyncOrchestrator to synchronize between two databases, and I am wondering if there is a simple way to ensure that some of my custom "after update" triggers do not get fired in the sync process.  Under normal circumstances, I wish for these triggers to behave when certain columns are updated in a table, however the sync process upon updating these columns is (naturally) firing the triggers as well.  Is there a simple way to avoid this?  I have attempted to introduce a flag which the trigger checks during a sync, however this solution is not fullproof in my opinion (i.e. the flag may be left set to a value which I do not want).  

    My question is: is there an elegant to prevent ANY triggers from being fired when performing a sync orchestration?  

    Perhaps another question: is a sync run automatically in a transaction?  If so, is there a way to add custom commands to a sync transaction?  

    Thank you,

    T. Andreasen


    Friday, March 11, 2011 11:36 PM

All replies

  • yes, syncs are automatically ran in a transaction. unfortunately, there are no extensions points to plug in or add additional custom sql commands to the one's ran by Sync Fx other than modifying the stored procedures used by Sync Fx itself.

    likewise, Sync fx needs to fire its triggers to update the metadata in the tracking tables as well.


    Sunday, March 13, 2011 2:19 AM
  • It sound as though the key to my problem is modifying the stored procedures.  How is this accomplished?  
    Monday, March 14, 2011 3:42 PM
  • there is nothing in the API that allows this, so you will have to go thru the stored procedures to manually or programatically alter them.

    there is a Script() method in the provisioning API that spits out the SQL script for the objects created by Sync Fx that you can intercept and alter if you want to add something.

    Monday, March 14, 2011 11:15 PM