Click below for Step by Step and Interview Q & A (dotnetinter) wrote,
Click below for Step by Step and Interview Q & A
dotnetinter

WCF Interview Questions: - What are the different ways of doing WCF concurrency and WCF instancing?

WCF concurrency

There are 3 ways of configuring WCF concurrency.

Single: - A single request has access to the WCF service object at a given moment of time. So only one request will be processed at any given moment of time.  The other requests have to wait until the request processed by the WCF service is not completed.

Multiple: - In this scenario multiple requests can be handled by the WCF service object at any given moment of time. In other words request are processed at the same time by spawning multiple threads on the WCF server object.
So you have great a throughput here but you need to ensure concurrency issues related to WCF server objects.

Reentrant: - A single request thread has access to the WCF service object, but the thread can exit the WCF service to call another WCF service or can also call WCF client through callback and reenter without deadlock.

WCF concurrency is configured by using concurrency mode attribute as shown in the below figure.

wcf

WCF instancing

Per Call: - New instance of WCF service are created for every call made by client.

Per session: - One instance of WCF service is created for a session.

Single instance: - Only one instance of WCF service is created for all clients.

To configure WCF instancing we need to use the InstanceContextmode attribute on the service as shown below.

code

See following video on WCF Concurrency and Throttling-



Click and see here on Step By Step Guide to Learn WCF
Tags: csharp interview questions, how to learn wcf, it interview questions with answers, programming interview questions, services, soa, step by step wcf, wcf, wcf concurrency, wcf instancing, wcf interview questions, wcf training
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments