Reputation: 71
i have a problem. I am developing ASP.NET app with WCF service. There is a custom session manager, which based on SessionID. I'm keeping session ids in static class, which stored in assembly with WCF service.
Sometimes, WCF service unexpectely restarts (or recreates?) and session manager clears with all ids of opened sessions. It's unacceptable in this project.
I readed about the InstanceContextMode/ConcurrencyMode attributes and a set them to "Single", but it has no effect: WCF service restarts all the same.
How to disable WCF service restarting?
Upvotes: 2
Views: 258
Reputation: 97
IIS may recycle application pool hosting your application for many different reasons. It means that the process hosting your application will be restarted and all data saved in static fields or classes will be lost.
In order to fix this I would suggest keeping your data in database or some other persistent storage instead of a memory. If this data is used very frequently you may consider creating in-memory cache on top of this persistent storage.
Upvotes: 1