none
Sync files from two mobile computers to a common file share RRS feed

  • Question

  • I am working on making a distributed application where all instances needs to synchronize some files into a common share.

    To synchronize the files, I am using two FileSyncProvider objects (local and remote) and a SyncOrchestrator object. The synchronizing is running continuously and I use the same objects each time.

    Is this the right way to do it?

    My problem is that when more than one application is synchronizing at the same time I get the following COMException error message:
        A storage engine operation failed with error code 25035 (HRESULT = 0x80004005, Source IID = {0C733A8B-2A1C-11CE-ADE5-00AA0044223D}, Parameters=(0, 0, 0, \\share\Test\filesync.metadata, , , )).

    Is there any way to get around this problem or do I just have to catch the exception and try again?

    Friday, September 18, 2009 12:35 PM

Answers

  • Hi -Bjerner -

    This is what SyncToy ( which uses File Sync Provider internally does), we do create seperate metadata files for each mobile computer on the share. I am guessing what you have is a local FileSyncProvider on each mobile computer - all of who are syncing some common files t/from a common share. You can create seperate metadata files for the common share for each mobile computer ( even though the data is the same).

    Thanks
    Deepa
    Deepa ( Microsoft Sync Framework)
    Thursday, October 8, 2009 3:21 PM
    Answerer

All replies

  • Only one connection at a time is allowed to the mdf files.
    I don't there would be a way to get around this problem (i.e. allow multiple connections), but retrying after catching the exception should work (although making the apps run sequentially would probably sound more reasonably in this case).

    Adrian
    Monday, September 21, 2009 8:32 PM
  • Only one connection at a time is allowed to the mdf files.
    I don't there would be a way to get around this problem (i.e. allow multiple connections), but retrying after catching the exception should work (although making the apps run sequentially would probably sound more reasonably in this case).

    Adrian


    Hi Adrian

    Thank you for your answer.

    I think that it would be difficult to have the apps to run sequentially as it runs from different computers and don't know about each other.
    Do you know any smart way to do this with the Framework?

    Would it be better to use different metadata files for each mobile computer on the share or would that mess everything up?


    Best Regards
    Bjerner

    Monday, September 21, 2009 9:41 PM
  • Hi -Bjerner -

    This is what SyncToy ( which uses File Sync Provider internally does), we do create seperate metadata files for each mobile computer on the share. I am guessing what you have is a local FileSyncProvider on each mobile computer - all of who are syncing some common files t/from a common share. You can create seperate metadata files for the common share for each mobile computer ( even though the data is the same).

    Thanks
    Deepa
    Deepa ( Microsoft Sync Framework)
    Thursday, October 8, 2009 3:21 PM
    Answerer
  • I have a similar issue. In my scenario, I have a folder with files on Computer A. And I need to synchronize these files to the folder on Computer B and Computer C. So basically, will have to synchronize from the common source to two or more destinations. All these computers are on the network.

    Synchronization is continually running on machines B and C. However sometimes I got the error  

           A storage engine operation failed with error code 25035 (HRESULT = 0x80004005, Source IID = {0C733A8B-2A1C-11CE-ADE5-00AA0044773D}, Parameters=(0, 0, 0, \\share\Test\filesync.metadata, , , )).

    Deepa,
    In reply to Bjerner, you said to "create separate metadata files for the common share for each mobile computer...." How can I do that? Can you explain a bit..
    Besides, Computer A doesnt have any knowledge of which other computer is synchronizing its data. However Computer B and Computer C does have knowledge that they are synchronizing their data with computer A. Please explaing how can I fix the above problem.

    Thanks,
    Thursday, January 21, 2010 11:31 PM
  • Hmm... old question but I'd also like to know how to specify separate metadata files since I have a setup similar to savy17: One machine opens a network share and multiple clients try to sync their local folders based on that share. I get a metadatastorageenginexception (code 25035) while creating the FileSyncProvider when running with more than one machine. Here is my code:

    try
    {
         providerNameA = new FileSyncProvider(Properties.Settings.Default.SyncFolderPath);
         providerNameB = new FileSyncProvider(share);
    }
    catch
    {
         return false;
    }
    
    providerNameA.Configuration.ConflictResolutionPolicy = ConflictResolutionPolicy.SourceWins;
    providerNameA.Configuration.CollisionConflictResolutionPolicy = CollisionConflictResolutionPolicy.SourceWins;
    providerNameB.Configuration.ConflictResolutionPolicy = ConflictResolutionPolicy.SourceWins;
    providerNameB.Configuration.CollisionConflictResolutionPolicy = CollisionConflictResolutionPolicy.SourceWins;
    
    syncOrchestrator = new SyncOrchestrator();
    syncOrchestrator.Direction = SyncDirectionOrder.Download;
    syncOrchestrator.LocalProvider = providerNameA;
    syncOrchestrator.RemoteProvider = providerNameB;
    stats = syncOrchestrator.Synchronize();
    

    By the way, is there a way to do this without a share and instead use .net remoting? Unfortunately FileSyncProvider is not serializable or derived from MarshalByRefObject, which would have been pretty cool...

    Thanks

    Alex

    Friday, September 30, 2011 5:01 PM
  • you can pass the metadata path in the FileSyncProvider constructor.

    e.g.

    FileSyncProvider myClientProvider = new FileSyncProvider("c:\\syncfolder",
    myFilter,
    myOptions, "c:\\syncmetadata", null, null);
    Saturday, October 1, 2011 12:07 AM
    Moderator