What does Instance mode means in WCF ?
Whenever a request come to the service, a object of service class is created and this object invoke the respective operations.
"Instance Context mode decide how long the service instance remains on the server."
Now the question is that after returning the response to client what happened with that service object.
Is this destroyed after the response?
Is this remain in server memory forever?
Is this remain on server for session duration of a client.?
There are 3 types of instancing mode.
1. PerCall : Whenever a request comes from client a new object of service class is created every time whether it is a new request or request is coming from same client session.
2. PerSession : A new instance of a service object is created for each new client session and maintained for the duration of the session.If the request again come from same client existing object of service class will serve the request.Data is also persist between service call from same client until session is expired.
3. Single : Only a single object of service class is created and this object is responsible to handle all requests for the lifetime of application whether the request come from same client or different client.
To specify the instancing mode you have to set InstanceContextMode attribute of [ServiceBehavior]
Visit following post for detailed implementation of PerCall , PerSession and Single instance context mode.
Instance-context-mode-in-wcf
PerCall-instance-context-mode-in-wcf
PerSession-instance-context-mode-in-wcf
Single-instance-context-mode-in-wcf.html
Related Post :
Message-exchange-pattern-in-wcf
Different-option-of-hosting-wcf-service
Binding-in-wcf-choosing-right-wcf-service
Hosting WCF with Non-Http protocol
Exchanging-metadata-in-wcf
Some-interesting-facts-about-data-contract
Knowntype-attribute-in-wcf
Associating-knowntype-in-wcf
Message-contract-in-wcf
Exception-handling-in-wcf
Exception Handling in WCF - SOAP Fault in WCF
Exception Handling in WCF - Unhandled Exception in WCF
Exception Handling in WCF - Creating and Throwing Strongly Typed SOAP Fault
Whenever a request come to the service, a object of service class is created and this object invoke the respective operations.
"Instance Context mode decide how long the service instance remains on the server."
Now the question is that after returning the response to client what happened with that service object.
Is this destroyed after the response?
Is this remain in server memory forever?
Is this remain on server for session duration of a client.?
There are 3 types of instancing mode.
1. PerCall : Whenever a request comes from client a new object of service class is created every time whether it is a new request or request is coming from same client session.
2. PerSession : A new instance of a service object is created for each new client session and maintained for the duration of the session.If the request again come from same client existing object of service class will serve the request.Data is also persist between service call from same client until session is expired.
3. Single : Only a single object of service class is created and this object is responsible to handle all requests for the lifetime of application whether the request come from same client or different client.
To specify the instancing mode you have to set InstanceContextMode attribute of [ServiceBehavior]
Visit following post for detailed implementation of PerCall , PerSession and Single instance context mode.
Instance-context-mode-in-wcf
PerCall-instance-context-mode-in-wcf
PerSession-instance-context-mode-in-wcf
Single-instance-context-mode-in-wcf.html
Related Post :
Message-exchange-pattern-in-wcf
Different-option-of-hosting-wcf-service
Binding-in-wcf-choosing-right-wcf-service
Hosting WCF with Non-Http protocol
Exchanging-metadata-in-wcf
Some-interesting-facts-about-data-contract
Knowntype-attribute-in-wcf
Associating-knowntype-in-wcf
Message-contract-in-wcf
Exception-handling-in-wcf
Exception Handling in WCF - SOAP Fault in WCF
Exception Handling in WCF - Unhandled Exception in WCF
Exception Handling in WCF - Creating and Throwing Strongly Typed SOAP Fault

No comments:
Post a Comment