locked
Microsoft.Synchronization.SyncOrchestrator.ThrowIfNotReadyAndNotCanceled() exception RRS feed

  • Question

  • Hi,

    I am using syncFX2.0 and getting following exception. I could not find any information about this.

    I would appreciate if someone can help me.

    Exception while Syncing Sync Group TradeSyncGroup ----------------------------------------------------------------------------------------------------------------- System.InvalidOperationException: This operation is not valid in any state of the object except forSyncAgentState.Ready or SyncAgentState.Canceled. at Microsoft.Synchronization.SyncOrchestrator.ThrowIfNotReadyAndNotCanceled() at Microsoft.Synchronization.SyncOrchestrator.Synchronize()

     

     

    thanks

    Sumit 

    Wednesday, March 24, 2010 8:24 PM

Answers

  • it is fine to have two different sync sessions in parallel (i assume the same replica is not involved in two different sync sessions at the same time).

    However, create a new SyncOrchestrator instance for each sync session, do not re-use them across the threads.

    Wednesday, March 24, 2010 11:29 PM

All replies

  • Can you paste the code where you are getting this?

    This exception is thrown when you call SyncAgent.Synchronize(), but SyncAgent.SessionState for that SyncAgent object is SyncSessionState.Synchronizing.

    This can happen if you use the SyncAgent object from two or more threads.

    Wednesday, March 24, 2010 9:30 PM
  • Hi Sid,

     

    Thanks for your reply. I am just making a call to synchronize method as following:

     

    syncStats = syncObject.SyncOrchestrator.Synchronize();

     

    Here syncObject is my object. But in my application it is possible to start two sync on different sync groups in parallel.

    Can that be a problem? I started doing this only after testing that running two syncs in parallel was not a problem in my test project.

     

     

    Thanks

    Sumit

     

     

    Wednesday, March 24, 2010 9:45 PM
  • it is fine to have two different sync sessions in parallel (i assume the same replica is not involved in two different sync sessions at the same time).

    However, create a new SyncOrchestrator instance for each sync session, do not re-use them across the threads.

    Wednesday, March 24, 2010 11:29 PM
  • Thanks, Sid Singh!!

     

     

    Thursday, March 25, 2010 8:32 PM