Closed pawelpawlow closed 6 years ago
I will try to repro, but .... why are you using an Enum as a concurrency column. Enums by their nature have only a very limited number of possible values whereas concurrency columns are traditionally used with datatypes with a very large range of values so that collisions become unlikely. I've never seen an enum as a concurrency value before.
Thank you Jay. Enum column is used together with the primary key column for concurrency. The Enum column represents state of a document. I don’t want to allow two transactions changing the state of the same document to “paid” at the same time. I allow two transactions changing for example column “notes” at the same time. What would you suggest for my scenario?
The problem was that the OriginalValues inside the EF entity were not being set for Enum types. Finally fixed in 1.6.6.
Trying to SaveChanges of a single enum property value update throws System.Data.Entity.Infrastructure.DbUpdateConcurrencyException.
The enum property is defined like this:
EntityTypeConfiguration for entity ZlecenieOplaty configures Stan with the following code:
I can see that the SQL generated by EFContextProvider agains the EF 6.1 DB is wrong ([Stan] is not changed, because @0 == @2, @2 has wrong value - should be 0).
In effect the following exception is thrown.