You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
If you encounter an I/O failure, then you cannot make any assumptions over the integrity of your underlying domain model. During saving, we're updating the object eagerly and deriving query and update information. If a save operation terminates while running the save command, you're left with an unknown state.
The only thing to recover is to retry the unit of work and potentially reload the object from the database (i.e. making your process idempotent).
Actual:
On save attempt
@Version
attribute is increased. When save fails due MongoSocketOpenException,@Version
attribute is not restoredAs 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
The text was updated successfully, but these errors were encountered: