-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
retryWrites false flag in mogoDb not working #22307
Comments
after a bit of testing. The issue cause by dbContext.SessionHandle. If SessionHandle is not null it will throw above error when save the entity. After exception once it will be able to save the data if send request again. SessionHandle will be null in that case |
Thanks @tungns0695 I will check this. |
hi @tungns0695 Does your MongoDB database support transactions? Is it
|
It's a single instance local mongodb server |
To put more context. In my service there's two repos . One for EF and one for mongo. The idea is we save data to EF first then save to mongo as snapshot. For mongo we don't require trasction for it at the moment. |
hi A version: "3.8"
services:
mongo:
image: mongo:8.0
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"]
ports:
- 27017:27017
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'127.0.0.1:27017'}]}) }" | mongosh --port 27017 --quiet
interval: 5s
timeout: 30s
start_period: 0s
start_interval: 1s
retries: 30 |
can we update document for mongo a bit so it's clear we should config mongo with replSet even using single instance? Due to the error message only let we know that we should set the retryWrites flag to false and i cannot find any document related to this from ABP. Also it's quite strange when first request we just startup the service it will crash but subsequence request work fine without any issue. |
ok, I will add a article. |
Is there an existing issue for this?
Description
I'm using Volo.Abp.MongoDB version 9.1.0.
Configuration string mongodb://localhost:27017/DbName?retryWrites=false
When i insert record to MongoDb it allways throw error "This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string."
Reproduction Steps
Install mongoDb and use Volo.Abp.MongoDB
Configuration string set to mongodb://localhost:27017/DbName?retryWrites=false
Expected behavior
Should be able to save data.
Actual behavior
Throw error This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.
Regression?
No response
Known Workarounds
Disable UnitOfWork or override InitializeDatabase and not pass SessionHandle to base method
Version
9.1.0
User Interface
Common (Default)
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
Windows (Default)
Other information
No response
The text was updated successfully, but these errors were encountered: