Getting error MongoDB Transactions with C# and the .NET Framework

I am getting

Standalone servers do not support transactions.

error for MongoDB Transactions. I referred this code to check this Transactions.
https://www.mongodb.com/how-to/transactions-c-dotnet

Kindly do the needful.

Thanks in Advanced

I am getting error as well using the same concepts. Command commitTransaction failed: WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction…’

Hi @Lawrence_Raja, and welcome to the community!

In order to perform multi-document transactions, your MongoDB deployment needs to be either a replica set or a sharded cluster.

The error message has indicated that the deployment that you have is a standalone. See also Transactions for more information.

Regards,
Wan.

Hi @Supriya_Bansal,

The error that you have encountered here is different to the original post. It seems that in your case, this is caused by more than one async operation trying to perform write operation on the same document.

For others to help you better, please open a new discussion thread with the following information:

  • MongoDB .NET/C# driver version
  • An example code that able to reproduce the problem that you’re seeing

Regards,
Wan.

Thanks @wan for the response. I realized it later that mine is a different problem.
I had created Write Conflict. Please let me know your thoughts.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.