-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Go Drivers
Context
We have pieces of code that take in a mongo.SessionContext and are to be run within a mongo transaction. The only real way to determine that today is to call StartTransaction() and check for an ErrTransactionInProgress, which is part of the /x/ package and not a stable API.
Wanted to propose expose a method as part of the stable API for identifying whether a mongo.SessionContext is running within a transaction or not.
Definition of done
The driver exposes a method on a mongo.Session that returns a boolean representing whether it is running within a transaction
Pitfalls