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

Optional manual Session management

    • Type: Icon: Improvement Improvement
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Transactions
    • None
    • Dotnet Drivers

      Background:

      Since there's hasn't been any activity on CSHARP-2890 for about five years now, I would like to propose a way to allow people who require C# `TransactionScope` an easier interface to implement it themselves by making `MongoClient` open to extension.

      Propose Changes:
      I think making `StartImplicitSession` `public`/`protected` (at least) `virtual` would suffice for this, allowing an easy management of session with `TransactionScope`.

      Motive:
      To illustrate the need for this I would like to present SwissLife-OSS/mongo-extensions: Extensions libraries for MongoDB. (github.com) package which achieves this support by extending the Client's each transaction related method, this is a well maintained package with over 138.8K downloads on Nuget, so there's clearly a need for this.

      Objection:
      To address some common questions about this proposal:

      1. Why can't you just use that extension library?
        A. Unfortunately due to our internal policies we are unable to use it.
      2. Why not extend the Client in similar manner as the extension library?
        A. It's requires much more maintainability, we would prefer a least intrusive solution as possible.

      3. Isn't Sessions API provided by MongoDb C# Drive provide essentially the similar functionality?
         A. Yes, but we require `TransactionScope` functionality (though limited in implementation in the end due to fundamentally different architecture) to have a uniform API across different DBs we gonna use.

        There are no Sub-Tasks for this issue.

            Assignee:
            boris.dogadov@mongodb.com Boris Dogadov
            Reporter:
            ahmad2smile@protonmail.com Ahmad N/A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: