Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-33738

Create a runCommand() override method to perform operations inside a transaction

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.0
    • Sprint:
      TIG 2018-03-26, TIG 2018-04-09, TIG 2018-04-23, TIG 2018-05-07, TIG 2018-05-21, TIG 2018-06-04

      Description

      The override should make it so that consecutive "insert", "update", "delete", "findAndModify" / "findandmodify", "find", and "getMore" commands occur in the same transaction by specifying autocommit=false and using the same txnNumber. The "commitTransaction" command should be executed when there's an uncommitted transaction associated with the session and Mongo.prototype.runCommand() is called for any other command.

      In order to handle the case where the last statement executed by the JavaScript test performs a command supported by multi-statement transactions, the test should be executed via a static JavaScript runner file that users a call to load() to execute the actual test and has a command such as "ping" run afterwards in order to commit the uncommitted transaction.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              robert.guo Robert Guo
              Reporter:
              max.hirschhorn Max Hirschhorn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: