Skip to content

Optimistic concurrency across sessions (e.g. when working with ViewModels/DTOs) #12684

Answered by ayende
miloszkukla asked this question in Q&A
Discussion options

You must be logged in to vote

You need to send the change vector to the client, and then get it back.
On saving it back, you can use the session.Store(product, productViewModel.ChangeVector, product, product.Id) overload, yes.
That will instruct RavenDB to do an optimistic concurrency check with the previous value.

do not modify the @change-vector metadata, that won't do what you want it to. The overload is the proper and supported way to handle this.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ayende
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants