In terms of WCF instancing mode, currently we have used singleton which I think it should be wrong as we use load balancer to approach the web services. I know that if WCF is in Singleton mode, there will be just one instance which is responsible for all requests “regardless of which endpoint” we point to. So as load balancer decides which endpoint to select this mode should be wrong! Do you have any suggestion on this?
Share
If you don’t keep any cross-request state in your service class (you shouldn’t!), just switch to PerCall (which you should). Have a stateless web-service with all mutable state being in the database, in a cache or encapsulated in some special-purpose class.
Stateful web applications have to be carefully designed to be correct. For example, what happens if you redeploy your app? All state will be deleted in the process. So you can’t have that state anyway.