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.

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.

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

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.

No comments:
Post a Comment