1

I have failed to understand over and over from this MSDN article why should we use it and how does it work:

  1. Datagram with sessions
  2. Request-response with sessions
  3. Duplex with sessions

Let's assume that I have a Service with

InstanceContextMode = InstanceContextMode.PerSession
ConcurrencyMode=ConcurrencyMode.Single

If I have 2 clients for this service and they activate a method in that setrvice at the same time, why should one of them wait until the service finish the other one request?; PerSession + 2 clients = "2" services that each of them have ConcurrencyMode.Single. Where is my mistake?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Stav Alfi
  • 13,139
  • 23
  • 99
  • 171

1 Answers1

2

As for the B part of your question, there is an excellent series of articles about WCF instancing, concurrency, and throttling here:

UPDATE

Check the instance context id, session id, and thread id on the service for each of your client calls and first verify that these are different.

To check instance context id:

OperationContext.Current.InstanceContext.GetHashCode()

To check session id:

OperationContext.Current.SessionId

To check thread id:

Thread.CurrentThread.ManagedThreadId

If they are all different for each client then I cannot explain the problem you are having.

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • 3
    @StavAlfi I can clearly see that hugh is more patient than me. You should *NEVER* say, "Just answer please" that's rude and assumes that someone owes a good response to you. 99% of the time that an answer doesn't help the asker it's because the question is poorly phrased or written. It happens to native and non-native english speakers and it's not a big deal. Rephrase or clarify your question--but don't demand answers. – Chris Pfohl Jun 08 '12 at 12:55
  • You are right, Im totaly apologize for my rudness. Thank you for your great anser. – Stav Alfi Jun 08 '12 at 15:40