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

Operations executed within transaction should not inherit read/write concern

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: 1.4.0
    • Component/s: None
    • Labels:
      None

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

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

              Created:
              Updated:
              Resolved: