[CSHARP-2907] Can't insert/update data while in a transaction Created: 21/Jan/20  Updated: 27/Oct/23  Resolved: 21/Jan/20

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 2.10.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Murilo Kunze Assignee: Jeffrey Yemin
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

windows 10, mongo 4.2


Attachments: PNG File retryWrite.png    

 Description   

I'm receiving the message "This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string." while I'm trying to insert data.
I've already disabled retryWrites but the problem is still happening:



 Comments   
Comment by Jeffrey Yemin [ 21/Jan/20 ]

Yes, that's definitely the case. The transaction implementation relies on the replication oplog, which is not present in standalone servers. You can, however, create a single-member replica set, which is almost as easy to manage as a standalone. See https://docs.mongodb.com/manual/tutorial/convert-standalone-to-replica-set/ for instructions. Good luck!

Comment by Murilo Kunze [ 21/Jan/20 ]

Hi Jeffrey, it's a standalone instalation.
I just noticed that the exception has an inner exception "Transaction numbers are only allowed on a replica set member or mongos". So can I conclude that transactions is not suported in standalone?

Comment by Jeffrey Yemin [ 21/Jan/20 ]

Hi murilokunze

We'd like to help you get past this problem, but to do that we'll need some more information. You mention that your application is connecting to a MongoDB 4.2 server, but we also need to know what the deployment scenario is. Is your application connecting to a standalone, a replica set, or a sharded cluster?

Generated at Wed Feb 07 21:43:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.