spring-data-mongodb
spring-data-mongodb copied to clipboard
Check MongoException error labels for recoverable transaction errors [DATAMONGO-2073]
Christoph Strobl opened DATAMONGO-2073 and commented
Check MongoException for lables TransientTransactionError, UnknownTransactionCommitResult indicating potentially recoverable transaction commit errors and translate them to TransientDataAccessException.
See MongoException#hasErrorLabel(String).
Issue Links:
-
DATAMONGO-2075 Open up MongoTransaction manager to allow transaction commit retry.
-
DATAMONGO-2291 MongoExceptionTranslator hides WriteConflicts
Referenced from: pull request https://github.com/spring-projects/spring-data-mongodb/pull/605
1 votes, 2 watchers
Mark Baker-Munton commented
DATAMONGO-2075 doesn't solve the problem entirely as some transaction errors can be thrown prior to a transaction commit operation.
WriteConflicts are one example:
1. begin tx
2. update document y
3. commit tx
If another thread/user modifies document y after beginning the transaction and before updating the document, an exception will be thrown on line 2 and not line 3
@christophstrobl do you have any plans to fix this issue?