Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 236969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:23:16+00:00 2026-05-11T20:23:16+00:00

The backgound: I am trying to forward the server-side ApplyChangeFailed event that is fired

  • 0

The backgound: I am trying to forward the server-side ApplyChangeFailed event that is fired by a Sync Services for ADO 1.0 DBServerSyncProvider to the client. All the code examples for Sync Services conflict resolution do not use WCF, and when the client connects to the server database directly, this problem does not exist. My DBServerSyncProvider is wrapped by a head-less WCF service, however, and I cannot show the user a dialog with the offending data for review.

So, the obvious solution seemed to be to convert the HTTP WCF service that Sync Services generated to TCP, make it a duplex connection, and define a callback handler on the client that receives the SyncConflict object and sets the Action property of the event.

When I did that, I got a runtime error (before the callback was attempted):

System.InvalidOperationException: This operation would deadlock because the
reply cannot be received until the current Message completes processing. If
you want to allow out-of-order message processing, specify ConcurrencyMode of
Reentrant or Multiple on CallbackBehaviorAttribute.

So I did what the message suggested and decorated both the service and the callback behavior with the Multiple attribute. Then the runtime error went away, but the call results in a “deadlock” and never returns. What do I do to get around this? Is it not possible to have a WCF service that calls back the client before the original service call returns?

Edit: I think this could be the explanation of the issue, but I am still not sure what the correct solution should be.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:23:17+00:00Added an answer on May 11, 2026 at 8:23 pm

    By starting the sync agent in a separate thread on the client, the callback works just fine:

        private int kickOffSyncInSeparateThread()
        {
            SyncRunner syncRunner = new SyncRunner();
            Thread syncThread = new Thread(
                   new ThreadStart(syncRunner.RunSyncInThread));
    
            try
            {
                syncThread.Start();
            }
            catch (ThreadStateException ex)
            {
                Console.WriteLine(ex);
                return 1;
            }
            catch (ThreadInterruptedException ex)
            {
                Console.WriteLine(ex);
                return 2;
            }
            return 0;
        }
    

    And this is my SyncRunner:

    class SyncRunner
    {
        public void RunSyncInThread()
        {
            MysyncAgent = new MySyncAgent();
    
            syncAgent.addUserIdParameter("56623239-d855-de11-8e97-0016cfe25fa3");
            Microsoft.Synchronization.Data.SyncStatistics syncStats = 
                  syncAgent.Synchronize();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I'm trying to create a pure D language implementation of functionality that's roughly
Background: I'm trying to come up with a regex for a rewrite rule that
Background: I'm trying to get a total line count of all of the code
Background I'm trying to write an application in C++ that will run on Vista.
Background I am trying to implement a RESTful web service using Apache-CXF that interacts
Background Trying to switch from using Interceptor to Events. I have a ValidationInterceptor that
I'm trying to extend my current app(internal company phonebook) to be able to forward
ANSWER: ******* For everybody else that overlook things: After you done all the other
My question is pretty straight forward. I am trying to style the background of
I have a problem in that I am trying to background load a sound

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.