locked
Problem with Provisionig scope with Static Filter using SyncFx 2.1 RRS feed

  • Question

  • Hello,

            I am using SyncFx2.1 in my application and found one problem with the provisioning scope with static filter.

    Here is the scenario I am working with and encountered a problem :

    I provisioned a scope for single table T with filtercolumn C1, which created the SyncFx objects- SPs, Triggers, _traking tables. The C1 column is added into the _tracking table and populated with the values from the base table T.

    Then I provisioned another scope  for the same table T with filtercolumn C2, which created the additional _selectchanges SP and added the column C2 into the _tracking table and populated the values for column C2 from the base table.

    But when I look at the Triggers (_UPDATE & INSERT) which are unchanged and have the Update & Insert statements only with the column C1 but not C2. The second scope provisioning dint edited the triggers for the newly added column C2.

    As the newly added column C2 is not included in Triggers the Update to the column C2 in base table does not reflect into the _tracking table and also inserting a new record into base table dint have the value for column C2 in _tracking table.

    Am I missing something here due what the Triggers are not being updated ?

    OR Having multiple scopes with different FilterColumns is still not supported in SyncFx2.1 ?

     

     

    -Ajinath


    Ajinath
    Wednesday, November 17, 2010 12:10 PM

Answers

  • Thanks Ajinath for reporting. This is bug in the SyncFx 2.1 Script() code which should be fixed in coming releases. For now, you have 2 options.

    1. Modify the provisioning script  on your own.

    2. Use the API call Apply() without scripting.

    thanks,

    Jandeep


    jandeepc
    • Proposed as answer by Jandeep Friday, November 19, 2010 11:20 PM
    • Marked as answer by AjinathWaghmode Monday, November 22, 2010 4:53 AM
    Friday, November 19, 2010 10:08 PM

All replies

  • how did you provision? i just did a quick test creating two scopes with different filter columns and the triggers were updated to include all columns used as filters.
    Wednesday, November 17, 2010 2:31 PM
  • I provision the scopes executing the script generated from SqlsyncScopeProvisioning.Script(). I edit the script to add the SET NOCOUNT ON statement in trigers before executing it.

    Code snippen is below :

                   string script = ServerConfig.Script();

                    script = script.Replace("] FOR INSERT AS\nUPDATE [side] SET [", "] FOR INSERT AS\nSET NOCOUNT ON\nUPDATE [side] SET [");
                    script = script.Replace("] FOR UPDATE AS\nUPDATE [side] SET [", "] FOR UPDATE AS\nSET NOCOUNT ON\nUPDATE [side] SET [");
                    script = script.Replace("] FOR DELETE AS\nUPDATE [side] SET [", "] FOR DELETE AS\nSET NOCOUNT ON\nUPDATE [side] SET [");

                    Server server = new Server(new ServerConnection(ServerConnection));

                    server.ConnectionContext.ExecuteNonQuery(script);

    I think as the triggers definition is being edited which is unknown to SyncFx, the SyncFx is not able to put the additional column in the Trigger.

    I need to put the SET NOCOUNT ON in triggers otherwise my nHibernate will not work :(.

    Is there any way to put the SET NOTCOUNT ON in the triggers and also have the SyncFx to add the columns in trigger for additional filters ?

     

    -Ajinath


    Ajinath
    Thursday, November 18, 2010 8:30 AM
  • looks like something funky going on in the Script() method.

    In my case, it generates an Alter Trigger but the trigger contents is the same.

    Friday, November 19, 2010 12:43 AM
  • Yes you are right JuneT. Something is funky happening with the Script() method.

    I see the script contains the statement for ALTER TRIGGER but it does not add the newly added column for either of the triggers. But it adds the newly added column to _tracking table and also populates the values for the new column from base table.

    In my case it adds the additional _select_changes sp.

    One more question I have is that why the default _selectchanges is not being preceded with the ObjectPrefix. All the SyncFx objects are being preceded with the ObjectPrefix except the default _selectChanges sp.

     

    Is this the bug with SyncFx 2.1 ? If yes, is there any workaround for the problem of Scrip() method where I can edit the Trigger's defination and add the SET NOCOUNT ON in it.

     

    -Ajinath


    Ajinath
    Friday, November 19, 2010 5:47 AM
  • Thanks Ajinath for reporting. This is bug in the SyncFx 2.1 Script() code which should be fixed in coming releases. For now, you have 2 options.

    1. Modify the provisioning script  on your own.

    2. Use the API call Apply() without scripting.

    thanks,

    Jandeep


    jandeepc
    • Proposed as answer by Jandeep Friday, November 19, 2010 11:20 PM
    • Marked as answer by AjinathWaghmode Monday, November 22, 2010 4:53 AM
    Friday, November 19, 2010 10:08 PM