umesh n

umesh n

  • NA
  • 36
  • 1.7k

OptimisticConcurrencyException in EntityFramework

May 31 2014 5:07 AM
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.