-
Type: Improvement
-
Resolution: Gone away
-
Priority: 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.
- is related to
-
CSHARP-2890 TransactionScope support for MongoDB
- Backlog