Spring-data-mongodb version: 2.2.0.RELEASE
Issue: MongoTemplate#upsert(Query query, Update update, Class<?> entityClass) method intermittently throws org.springframework.dao.DuplicateKeyException.
Things I have checked:
- There is only one index in my mongo doc which is the @Id index
- I am querying with the above index in the upsert method call
- There is already a document existing with this id in the collection (i.e. this is not insert scenario), hence not the same as https://jira.mongodb.org/browse/SERVER-21006?focusedCommentId=1065415&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1065415
Comment From: snicoll
@rahul-jangra this issue tracker is for the spring framework. Spring Data MongoDB has a dedicated issue tracker. Regardless, as we prefer to use the issue tracker only for bugs and enhancements, please post a question on StackOverflow first. Sharing a small sample there will help you get support.