Expose method on the mongo session to determine if it is being run within a transaction

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      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

       

            Assignee:
            Unassigned
            Reporter:
            Jonathan Lee
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: