Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3431

Make MongoClient IDisposable to allow short lifetime scope usage

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • 3.0.0
    • None
    • Configuration
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      According to existing implementation the general advice on MongoClient usage is singleton lifetime scope.

      Lately several small issues (e.g. CSHARP-3424) arose which require per-instance use of MongoClient. This lifetime scope will result in excessive memory usage and undisposed resources.

      These small issues could be mitigated by making MongoClient IDisposable and changing the design accordingly to allow usage with short lifetime scope.

      Attachments

        Activity

          People

            boris.dogadov@mongodb.com Boris Dogadov
            mikalai.mazurenka@mongodb.com Mikalai Mazurenka (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: