Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Remove calls to MongoServer.Disconnect #2
Via a comment on original blog post:
It turns out that the disconnect should not usually be invoked; it's better to let the driver handle the connection pooling internally.
See for example this blog post: http://craiggwilson.wordpress.com/2012/09/23/disconnecting-with-the-mongodb-driver/"
Bottom line, is that there is no need to call Disconnect() on a MongoServer instance. The API docs for the C# (http://api.mongodb.org/csharp/1.6/html/71b2d2c6-4c2d-ec27-b465-071dee0dd2f6.htm) state: "Disconnects from the server. Normally there is no need to call this method so you should be sure to have a good reason to call it." - I have no good reason to call it, so will remove those calls.