Incorrect total price on "order" document when its order items are being updated concurrently

Sorry about the delay but I’m still curious to understand what happens and not seeing all of the code I find myself guessing here.

Can you explain what APIs you are using? This looks close to our node.js API examples but not exactly - so I’m wondering if the issue is in some of the supporting code.

For instance I’m not sure what the services.common.startDbSession() call does as I couldn’t find any references to it anywhere - if that your own wrapper of startSession()? Your subsequent calls are on `services.query().model.updateOne().session(session) - is this Mongoose wrapper over MongoDB Node.js driver? Or some other wrapper?

If you can’t share the code, you can run this with logging increased on the DB side and confirm that in fact transaction is starting when you think it’s starting and all the writes are showing up before commitTransaction - otherwise it’s really hard to say what’s happening when you run this code.