WCF : Diffrence between Session and Instance
-
A session is a series of one or more communications between the service and a client, whereas an instance is an instance of the service class itself. When an instance is created is controlled by the InstanceContextMode parameter of the ServiceBehavior attribute. It is per call - that is, a new instance is created (and destroyed) every time a request is sent to the service; per session - a new instance for each session; or single, meaning that only one instancce of the service is ever created while it is running. Sessions in WCF != ASP .NET Sessions. I believe they have to be manually created and destroyed, although I've only ever used per-call service instances. Hope this helps.
-
A session is a series of one or more communications between the service and a client, whereas an instance is an instance of the service class itself. When an instance is created is controlled by the InstanceContextMode parameter of the ServiceBehavior attribute. It is per call - that is, a new instance is created (and destroyed) every time a request is sent to the service; per session - a new instance for each session; or single, meaning that only one instancce of the service is ever created while it is running. Sessions in WCF != ASP .NET Sessions. I believe they have to be manually created and destroyed, although I've only ever used per-call service instances. Hope this helps.