Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3259

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

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.0
    • 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

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            jonathan.lee@mongodb.com Jonathan Lee
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: