locked
How does SyncKnowledge know about item changes RRS feed

  • Question

  •  

    Hey,

     

    When I look at the SyncKnowledge class there is no way of letting the object know that these are the items that have changed.

     

    So, during the sync process when the providers are exchanging thier SyncKnowledge objects how do they identify changes.

     

    The SyncKnowledge class has a Contains method where an ItemID can be passed but how can the object search since it has not method to register an item change.

     

    Thanks,

    -Sarav

    Tuesday, November 25, 2008 6:35 PM

Answers

  •  

    let's say your replica knowledge K1 says "I know all changes on Replica A up to tick Count 50 and all changes on Replica B upto tick Count 100".

     

    Now you give this knowledge an item I1A with last change version (Replica A, 25) and ask K1.Contains(I1A)?

     

    Since I1 was last updated by Replica A at tick Count 25, and the knowledge knows all changes in Replica A upto tick Count 50, it will say, yes I know about the changes to I1(Replica A, 25).

     

    Now B may have another version of I1 (I1B), since it may have updated it locally, and on B the last update version of I1 is (Replica B, 120).

     

    Now if you ask K1.Contains(I1B), it will say no, I1 has a higher ReplicaB tick count (120) than what I know (100).

     

    Tuesday, December 2, 2008 10:48 PM
    Moderator

All replies

  • The knowledge that a replica stores is a compact way of storing what that replica knows about changes in other replicas.

     

    Knowlege will typically store the last time (tickcount) it synced with each replica. If the item's last update version is greater than what the replica knows about the other replica that last modified that item, then knowledge.contains will return false, which means that the replica doesn't know about this last item change, and so need to udpate it.

     

    Having a compact knowledge representation and methods to detect changes enables us to do fast change detection, conflict detection etc.

     

    Tuesday, November 25, 2008 7:52 PM
    Moderator
  • I am having a hard time understanding how the sync knowldge knows about an itemchange. 

    Everytime, I update an item in my datasource and create an itemchange for my metadatastore I also update the tickcount on the syncknowldge object - syncKnowledge.SetLocalTickCount. But, there is no method on the syncknowledge object to let it know that I updated a specific item at the tickcount. 


    Thanks,

    Sarav
    Tuesday, December 2, 2008 10:41 PM
  •  

    let's say your replica knowledge K1 says "I know all changes on Replica A up to tick Count 50 and all changes on Replica B upto tick Count 100".

     

    Now you give this knowledge an item I1A with last change version (Replica A, 25) and ask K1.Contains(I1A)?

     

    Since I1 was last updated by Replica A at tick Count 25, and the knowledge knows all changes in Replica A upto tick Count 50, it will say, yes I know about the changes to I1(Replica A, 25).

     

    Now B may have another version of I1 (I1B), since it may have updated it locally, and on B the last update version of I1 is (Replica B, 120).

     

    Now if you ask K1.Contains(I1B), it will say no, I1 has a higher ReplicaB tick count (120) than what I know (100).

     

    Tuesday, December 2, 2008 10:48 PM
    Moderator