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

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

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0, 1.6.0alpha1
    • Labels:
      None

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: