Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1231

Add Session::isInTransaction to indicate whether a transaction is active

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.0alpha1, 1.6.0
    • Affects Version/s: None
    • Component/s: None
    • None

      In order for PHPLIB-368 to determine whether it is permissible to inherit a read/write concern from the object on which an operation is executed (e.g. Collection), it requires some way of discerning whether a Session is in a transaction.

      If you look at CR: prohibit per-operation options in txn for CDRIVER-2558, you'll see that libmongoc internally uses _mongoc_client_session_in_txn() to check if a session is in an active transaction before deciding whether to inherit class-level defaults for read/write concern. In order to facilitate that logic in PHPLIB, PHPC may require that method to be exposed in libmongoc's public API.

      I also spoke to kevin.albertson about exposing the various transaction states to PHP, but we agreed that's not really necessary for this so we should err on the side of not creating public API without good reason (libmongoc also doesn't seem to expose txn state to the user in any way).

            Assignee:
            derick Derick Rethans
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: