I’ve been ranting to some colleagues about a particularly useful table that showed the interactions between WCF’s InstanceContextMode and ConcurrencyMode behaviors.  I referenced it in a conversation again today and decided that I needed to go hunt down the phantom table so that it haunted me no longer.

I thought the table was in Lowy’s Programming WCF Services. Full attribution to Essential Windows Communication Foundation: For .NET Framework 3.5, one of my other favorite WCF books. I’ve copied the table below so that I can refer to it by hyperlink forever more.

The table is awesome because it shows you the results of the different ways of combining these two important WCF concurrency settings, including the default combination.  Without some trial and error, it’s not always easy to intuit what the combination of these settings means. This table makes it easy.

WCF Context and Concurrency

One Response to “WCF Concurrency and Instancing”
  1. Mike Woytowich says:

    Hey Thomas,

    Thanks for posting this! I could have used it a couple weeks ago while debugging a concurrency related issue for a WCF service – it would have significantly reduced the amount of thinking I had to do. While doing some performance testing of a business process that spanned several WCF services, I ran into a concurrency related issue. We had the InstanceContextMode set at PerCall but still had the problem. Why? The service was also getting some information for processing from the database. Changing to InstanceContextMode to Single was the workaround until we could make the real fix since we don’t want a singleton running for this service in production.



Leave a Reply