-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
MongoExceptionTranslator hides WriteConflicts [DATAMONGO-2291] #3148
Comments
Christoph Strobl commented A workaround, until DATAMONGO-2073 is resolved, could be Spring Retry and its annotation based approach that allows to evaluate a SpEL expression on failure via |
Any update on that issue? |
Any updates? |
We have the same issue here! Any news? |
Rebased and modified existing PR #605 that introduces |
Are there any plans to merge this PR? I just hit the same issue and the PR looks like it'd fix it. |
so what is the status of this please? |
Also just spend some time finding out the problem. In my case, the collection didn't exist yet, and creating it multiple times failed. Would be nice to have more in the logs. |
I am also standing on same issue, any updates on this issue fix |
Christian opened DATAMONGO-2291 and commented
With transactions enabled, it can happen, that the mongodb throws a WriteConflict-Exception. This kind of exception can happen, if two transactions modify the same document in parallel.
In this case, the application could retry the transacion and would probably succeed.
Sadly spring-data-mongodb hides the transaction by wrapping it into an
UncategorizedMongoDBException
. Further down in the stack it first created aMongoCommandException
, where the errorcode was at east still present.Solutions:
Wrap the exception instead into
TransientDataAccessException
or into aOptimisticLockingException
or keep the errorCode in theUncategorizedMongoDBException
.Here the stacktrace:
Affects: 2.1.8 (Lovelace SR8)
Issue Links:
1 votes, 3 watchers
The text was updated successfully, but these errors were encountered: