I’m using the newest EF core library (8.2.3) and when i’m working locally i’m turning off the transactions (since running cluster locally is a bit of a chore).
I’m using Database.AutoTransactionBehavior = AutoTransactionBehavior.Never;
flag for that, and it works like expected.
Lately i turned on context pooling AddDbContextPool
and i see that whenever i try to do more than one thing with single DbContext instance i have this exception:
The MongoDB EF Core Provider now uses transactions to ensure all updates in a SaveChanges operation are applied together or not at all. Your current MongoDB server configuration does not support transactions and you should consider switching to a replica set or load balanced configuration. If you are sure you do not need save consistency or optimistic concurrency you can disable transactions by setting 'Database.AutoTransactionBehavior = AutoTransactionBehavior.Never' on your DbContext.
I’ve made sure that the behavior is indeed set to Never. Is that behavior expected? Is it a bug of MongoDB adapter or maybe EF itself?