locked
SqlCeMetadataStore / SqlCeReplicaMetadata : enumerate ItemMetadata items RRS feed

  • Question

  • Hi all,

    I'm using right now SqlCeMetataStore/SqlCeReplicaMetadata and I need to get ALL ItemMetadata contained in the store.
    Are there any methods / properties that return that ?

    I saw there was a few methods like FindItemMetadataByIndexedField but i dont want to filter items, i just want all of them.

    Actually that would be great if SqlCeReplicaMetadata class would implement directly IEnumerable<ItemMetadata>

    Thanks for your help,
    Alexandre
    • Moved by Max Wang_1983 Thursday, April 21, 2011 10:08 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Wednesday, April 16, 2008 8:37 AM

Answers

  • This was considered but investigation shows in real provider scenario, this is seldomly needed.

     

    A work around to this, mostly for testing purpose, you could define a custom field, and assign a constant to every item for this field, then call FindItemMetadataByIndexedField.
    Thursday, April 17, 2008 6:15 PM
    Answerer

All replies

  • This was considered but investigation shows in real provider scenario, this is seldomly needed.

     

    A work around to this, mostly for testing purpose, you could define a custom field, and assign a constant to every item for this field, then call FindItemMetadataByIndexedField.
    Thursday, April 17, 2008 6:15 PM
    Answerer
  • Hi Jin,

    Thanks for your answer.
    Yes it is what i used for the moment, a custom constant field in the SqlCe DB and the FindItemMetadataByIndexedField method.

    I needed to do that in order to determine local deletes, by comparing the data store and metadata SqlCe store.

    Alexandre



    .
    Friday, April 18, 2008 7:31 AM
  • To detect local deletes, the SQL CE metadata store shipped with sync framework can help you do that.

     

    The logic is like this, when using metadata store for change detection:

    - For any existing items in the data store,

      if it's changed, you will give it a new version in the metadata store.

      if it's new, you will give it a new version in the metadata store too.

      if it's not changed, you use ReportLiveItem method to report its existence in the metadata store.

    - After all existing items are processed,

      the GetUnreportedItems will give you all the local deletes, then you can mark earch one of them deleted by using MarkAsDeleted.

     

     

    Saturday, April 19, 2008 12:14 AM
    Answerer
  • Hi!

     

    I am trying to create a provider for WebDav (Exchange) and iterating the items and creating the metadata as mentioned in the previous post.

     

    However I run into problems after the iteration and when the update item context is null.

     

    When should the iteration occur? Right now I am doing it in BeginSession is this the correct way of doing it? I am able to create items that are not in the knowledge/metadata and also delete unreported items but NOT update items.

     

    Any help appriciated!

     

    Martin

    Thursday, April 24, 2008 8:12 PM
  • Hi Jin,

    Where are these methods ReportLiveItem or GetUnreportedItems ? I couldn't find them in SqlCeMetadataStore or SqlCeMetadata classes.

    Thanks,
    Alexandre
    Wednesday, April 30, 2008 4:46 PM
  • On the ReplicaMetadata.DeleteDetector.

     

     

    Monday, May 5, 2008 6:17 PM
    Answerer