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

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

    • Fully Compatible
    • v4.0
    • TIG 2018-03-26, TIG 2018-04-09, TIG 2018-04-23, TIG 2018-05-07, TIG 2018-05-21, TIG 2018-06-04

      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.

            Assignee:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: