-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Spec Comp, Transactions
> 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.