Întrebare Handling association tables

  • 27 czerwca 2012 13:02
     
     

    I have the following tables in my application.

    User (UserID,  ......)

    Category (CategoryId, ......)

    UserCategory (UserId, CategoryId);

    Item (ItemId, CategoryId,......)

    The "UserCategory" table is used to control access to items. A given user only has access to items that belongs to categories that he has access to. I need to sync this data to a iPad app (its one way sync and no data is modified on the iPad). I use a filter to make sure that only relevant categories and items are sent to the client app. The problem is if later we assign an existing category to a user the items belonging to the category are not synced. 

    Thanks,

    Chamindu.

Wszystkie odpowiedzi

  • 28 czerwca 2012 01:23
    Moderator
     
     

    sync framework doesnt support partition realignment or rows going in and out of scope (or dynamic filtering).

    in your case, even if you assign the existing category to a user, the change is usercategory table but there is no actual change to Category, so no change is detected for Category.

    try doing a dummy update to the Category row you just assigned and that should flag it as changed. however, this also means other clients will download it even though there is no change.