Entity Framework – Entity Framework optimistic concurrency exception
•
Java
Should I maintain the timestamp property on my model class to enable optimistic concurrency for data updates and deletions? If I don't use such a property, will EF give concurrent exceptions at run time?
Do you have to enable concurrency?
[Timestamp] public byte[] RowVersion { get; set; }
Solution
Yes, or you decorate an attribute with [concurrencycheck] Otherwise, you will finally win the scene
Edit:
Official tutorial on how to handle Concurrency:
Handling Concurrency with the Entity Framework in an ASP. NET MVC Application
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码