-
I insert some Config into my Ravendb and use optimistic concurrency. If i insert the same Document the second time with the same Name the ConcurrencyException is getting Thrown. Thats the intended behaviour. But even if i Catch the ConcurrencyException i got the same Exception with the RavenDB error in the middleware again. This behaviour is unexpected. We use ASP.Net 6 and the below code gets called in our API Controller.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Are you using the same session again? Once you got If you are calling You can call |
Beta Was this translation helpful? Give feedback.
Are you using the same session again? Once you got
ConcurrencyExcpetion
you should create a new session.If you are calling
SaveChangesAsync
in the middleware, it does the same operation, and it will fail again.You can call
session.Advanced.Clear()
to reset the entire state, so the middleware call with be a noop.