Support us .Net Basics C# SQL ASP.NET ADO.NET MVC Slides C# Programs Subscribe Buy DVD

Part 36 - Instancing modes in WCF

Suggested Videos
Part 33 - OneWay Message Exchange Pattern in WCF
Part 34 - Duplex message exchange pattern in WCF
Part 35 - Sending large messages in WCF using MTOM



In this video we will discuss, different instancing modes available in WCF. Instancing modes are also called as instance context modes.

Instance context mode dictates, how long the service instance remains on the server.
Instance context modes in wcf



There are 3 instancing modes 
1. PerCall - A new instance of service object is created for every request, irrespective of whether the request comes from the same client or a different client.

2. PerSession - A new instance of the service object is created for each new client session and maintained for the duration of that session.

3. Single - A single instance of the service object is created and handles all requests for the lifetime of the application, irrespective of whether the request comes from the same client or a different client.

How do you specify what instancing mode you want to use?
Use ServiceBehavior attribute and specify InstanceContextMode.
instancing modes in wcf

In our next video, we will discuss each instancing option and their implications with an example.

wcf tutorial

No comments:

Post a Comment

If you like this website, please share with your friends on facebook and Google+ and recommend us on google using the g+1 button on the top right hand corner.