spring-data-mongodb icon indicating copy to clipboard operation
spring-data-mongodb copied to clipboard

Optimistic @Version is increased when update fails due MongoSocketOpenException

Open michaldo opened this issue 1 year ago • 2 comments

Actual: On save attempt @Version attribute is increased. When save fails due MongoSocketOpenException, @Version attribute is not restored As result, when socket connection is back, save fails due OptimisticLockingFailureException

Expected: when save fails, @Version attribute should be restored. When socket connection is back, save should succeeded.

spring-data-mongodb 4.1.5

SO question: https://stackoverflow.com/questions/77498546/optimistic-version-is-increased-when-update-fails-due-mongosocketopenexception

michaldo avatar Nov 30 '23 11:11 michaldo

If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.

christophstrobl avatar Nov 30 '23 11:11 christophstrobl

Voila: https://github.com/michaldo/spring-data-mongo-4576

michaldo avatar Nov 30 '23 18:11 michaldo