Saturday, February 25, 2012

Publication changes not appearing at subscriber?

I have setup a merge replication publication (SQL server 2005 wth SQL Mobile) with dynamic filters based on host name and when i sync to the pda all data appears fine. When I make changes on the PDA and synchronise, the changes are pushed back to the server fine.

However when I change data on the server and synchronise at the PDA, no changes ever appear!

Surely I must have missed something obvious or done something really stupid.

If i check the replication monitor it just says no changes so any suggestions would be great.

Thanks,

Andy

Ok, Ive managed to prove that if there is no @.subset_filterclause specified, it works fine. As soon as the filter is turned on i cannot add any new rows.

The filter is quite complex and as far as I can see, it will always fail because of the order in which records are added to the database. Can anybody clarify?

I have an organisation table and account management tables. The filter says download organisations that you are the account manager of. THerefore the organisation record is saved before the account management due to dependencies and at the point of creating the org, the trigger will fail because the account management record will not exist.

Surely this must be a standard problem so what am i doing wrong?

|||

After using one of our gold partner support calls, Microsoft have diagnosed the problem as my use of precomputed publications. This option in 2005 means that each insert fires a trigger which in turn evaluates the filter conditions.

In my case when i added a new organisation, it checked if the organisation was inside the users account management roles. This fails because the account management row has not yet been inserted (and cannot be added until after the org due to FK's.

The simple solution was to turn off precomputed partitions which sorted the problem.

Apparently it should be possible to use precomputed partitions if I define a row filter based on the last row to be inserted with all other rows linked through join filters. However, the suggested filters didnt work so I will try a bit more when i get an hour spare (in 2027 Wink )

No comments:

Post a Comment