I am getting from Mongodb Exception:
Caused by: com.mongodb.MongoCommandException: Command failed with error 112 (WriteConflict): 'WriteConflict error: this operation conflicted with another operation.
Got this error when used @Transactional Spring Boot Annotation. Tried to insert two documents, one should be inserted successfully and other should roll back because of duplicate key (Unique Index).
But this exception was not expected, instead DuplicateKeyException was expected. Before using @Transactional, I was getting DuplicateKeyException.