Ok, we have the following scenario, but how are you Optimistic lock
we have customer class
Version is a collision variable (int), which, when editing a line, the version will increase by 1.
Now we have Martin, who opens Customer 129, since in the model of representation, the model object is smoothed in Model View, and then goes to the client’s editing screen.
David at this time also opens Client 129 for editing, changes the name and saves.
Martin, who was still editing the client (now the old version), goes to save his changes, at this point I hope you see a blocking errorQuestion: how do you handle optimistic locking with NH (using FluentNHibernate for comparisons) would you do
- need to click verion number in ViewModel? then when it was sent with the update, load the current Model object and check the version number
- Or is this the best way (I know NH will do version control if I download, edit and update in the same session)
one additional thing, this script will be used on a farm, not for cache sharing
thank you very much in advance
source
share