none
Sync Framework 2.1 - Cannot access a disposed object. Object name: ChangeBatchBase RRS feed

  • Question

  • We are using Sync Framework 2.1 with sqlce to sync between two sqlce databases using wcf. This is based on the sample WebSharingAppDemo-CEProviderEndtoEnd. This has been working really well in a aplha version for several months now.

    In the last couple of days we started getting random "Cannot access a disposed object.  Object name: ChangeBatchBase" error when trying to sync. It was somewhat inconsistent on the tables and scopes where this was occurring. After spending more than a day trying to trace this problem, I switched from WSDualHttpBinding to WSHttpBinding (as in the original sample) So far, this seems to have solved the issue. (I had been trying to implement a DuplexContract, which is why we started using WSDualHttpBinding.)

    Does WSHttpBinding have to be used for wcf with Sync Framework? Does it make sense that I was having problems with WSDualHttpBinding? If not, maybe there was some configuration I was missing when trying to use WSDualHttpBinding.

    In any case, anyone that sees this error may hopefully benefit form this post.

    On a slightly separate note, we are trying to find a way to have the sync framework wcf service signal back to our app when it finishes processing a sync. This is why I was trying to implement DuplexContract. I could not make this work, because I found that the proxy must inherit from KnowledgeSyncProvider for sync framework, but for DuplexContract it must inherit from System.ServiceModel.DuplesClientBase. I hope my understanding is correct. Any suggestions on how to achieve this callback from the wcf service would be helpful.

    Thanks,
    Tim

    Tuesday, May 24, 2011 9:34 AM

Answers

  • Yunwen,

    Thank you for your reply. I am sorry, I did not keep a copy of the trace - I should have! I looked at the trace and to me it did not provide clues, so I did not think to save it... At this point it would be quite a bit of work to  switch back to WSDualHttpBinding, and to try to re-create the error again - if I get a chance I will try to. It appears Sync Framework cannot be used with DuplexContract, so we now no longer have a need to use WSDualHttpBinding. We are exploring other ways to build some communication from the Sync Framework service back to our app.

    Thanks,
    Tim

    Friday, May 27, 2011 9:56 PM

All replies

  • I cann't recall this was reported before. seems to be some sort of threading safe related. do you have a trace when the error occured ?

    thanks

    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, May 27, 2011 5:26 PM
    Moderator
  • Yunwen,

    Thank you for your reply. I am sorry, I did not keep a copy of the trace - I should have! I looked at the trace and to me it did not provide clues, so I did not think to save it... At this point it would be quite a bit of work to  switch back to WSDualHttpBinding, and to try to re-create the error again - if I get a chance I will try to. It appears Sync Framework cannot be used with DuplexContract, so we now no longer have a need to use WSDualHttpBinding. We are exploring other ways to build some communication from the Sync Framework service back to our app.

    Thanks,
    Tim

    Friday, May 27, 2011 9:56 PM
  • Thanks for the info. please do post us a messge if you have any update on this.

    thanks

    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, June 2, 2011 6:00 AM
    Moderator