Transaction is not used in Mongoose create operation after OpenTelemetry auto-instrumentation is added #1678
Labels
bug
Something isn't working
priority:p1
Bugs which cause problems in end-user applications such as crashes, data inconsistencies
What version of OpenTelemetry are you using?
What version of Node are you using?
v16.15.1
What did you do?
When running some database operation inside the transaction
What did you expect to see?
It is expected the transaction will be aborted, and user with name "staffA" will not be created in the database.
What did you see instead?
The transaction was not rolled back, and the record was created in the database.
Additional Info
I am using "mongoose": "^6.2.1"
The transaction works with
findOneAndUpdate
, for example the user name is not changed tostaffB
in the following caseHowever, when session is used in the
create
operation, thelastUse
inserverSession
is not updated across the whole function, which means the session is not used at all.The text was updated successfully, but these errors were encountered: