MongoDB handle concurrency

My Project is implemented on ASP .NET framework with MVC. I am trying to only use a single connection for my multithreaded application with request queueing. I am stuck on the connection string. I couldn’t find a way to keep only one connection open for throughout the application. I tried Dependency Injection and Singleton pattern both failed because I got many errors in the code. Can anyone please refer me some concrete code I could look into achieve concurrency control and thread safety in my Application. Do I only need to provide correct connection string or have to use locks or something ? I really don’t have any idea since I am new to this.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.