Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.instancecontextmode.aspx" rel="nofollow">InstanceContextMode</a> property indicates how WCF will create instances of your service class and whether those instances will be reused across requests.</p> <ul> <li><strong>PerSession</strong>: (the default) an instance of your service will be created for each WCF session, for channels that support sessions (otherwise, the behavior is the same as PerCall); this value is useful if you maintain state within your service class for each client session</li> <li><strong>PerCall</strong>: a new instance of your service class will be created for each WCF operation (method call) from the client</li> <li><strong>Single</strong>: only a single service instance will be created within the host process, which will service all incoming requests; all calls will be serialized to the service unless the service's <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.concurrencymode.aspx" rel="nofollow">ConcurrencyMode</a> behavior is set to <code>Multiple</code>.</li> </ul> <p>For high-volume stateless services, using <code>Single</code> and <code>ConcurrencyMode.Multiple</code> can reduce the number of service instances allocated and the associated pressure on the garbage collector. WCF doesn't require/assume that your service is stateless, though, which is why <code>PerSession</code> is the default.</p> <p>You can verify the behavior of the different instance context modes by setting a breakpoint in your service's default constructor.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload