Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-368

Operations executed within transaction should not inherit read/write concern

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.5.0
    • Labels:
      None

      Description

      Various operation methods in PHPLIB inherit a readConcern or writeConcern from the current class (e.g. Collection) if an explicit option is not provided by the user. For example, see Collection::insertOne(). This can be problematic if the operation is being executed within a transaction (see: Users cannot pass readConcern or writeConcern to operations in transactions).

      To address this, PHPLIB may need to discern whether a session option has been passed and whether a transaction has already been started on that session. I'm not sure if the MongoDB\Driver\Session API makes this possible, so this fix may actually require API improvements in PHPC itself if we need to introduce an isInTransaction() method (or similar).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jmikola Jeremy Mikola
              Reporter:
              jmikola Jeremy Mikola
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: