I just noticed that when a SqlException
occurs while updating data using Entity Framework, all subsequent calls to SaveChanges
will fail because the Entity that caused the exception is still in the "queue" to be saved.
This just stung us on a live system as many users were not able save their data due to some failed update with error 'string or binary data would be truncated
'. We just had to resort to recycling the application pool.
How can I remove/reset the offending object and let other updates go through?
EDIT: Better yet, what is the best way of handling Sql Exeptions that occur during insert/update?