0
Answer

OptimisticConcurrencyException in EntityFramework

umesh n

umesh n

10y
1.7k
1
OptimisticConcurrencyException in EntityFramework

I am using entity framework 4.3.0, while calling context.SaveChanges(), exception thrown with message...

System.Data.OptimisticConcurrencyException--> Message: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.

i googled for solution and i found that i have to refresh the context like,

context.Refresh(RefreshMode refreshMode, Object entity)

but, there is no any Refresh method for the context..
* EF(v4.3.0) does not include this functionality?
* so what should be another way to fix it..

thanks in advance.