MongoDb C# Transaction has been aborted when writing to database

Viewed 1549

I am doing a transaction in a MongoDb database and when inserting or deleting I get the following exception:

Command insert failed: Transaction has been aborted

. However I am not aborting the transaction deliberately. I tried reducing the commands sent to the database to a minimum but the exception still happens.

1 Answers

Turns out there was a time limit for transactions. I ran the following command in the mongo shell and the transaction could complete.

db.adminCommand( { setParameter: 1, transactionLifetimeLimitSeconds: 3000 } )
Related