Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1665

count_documents helper does not start transactions

      https://github.com/mongodb/specifications/blob/master/source/transactions/transactions.rst#constructing-the-first-command-within-a-transaction says:

      > When constructing the first command within a transaction, drivers MUST add the lsid, txnNumber, startTransaction, and autocommit fields.

      It seems to me that this only happens for write commands, because tests added in https://github.com/mongodb/specifications/pull/364 / https://jira.mongodb.org/browse/DRIVERS-550 which do start_transaction -> count_documents -> commit_transaction never change session state from starting_transaction and thus do not send a commit to the server.

      Collection#count_documents does not seem to properly start transactions when passed a session in the STARTING_TRANSACTION state. This should be fixed.

            Assignee:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: