I have a cached data manager which fetches data from database and returns it to the grid. Every time that data manager has to fetch some data there is a method to clear dataset that consists of some other methods but also uses _dataset.rejectChanges() method.
Problem: _dataSet.rejectChanges() method throws “RowNotInTableException: This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row.”
Also this exception isn’t thrown every time, instead it’s random. (I suspect other users interacting with my cached data manager and this causing some weird problems)
Is it even possible that other users might cause this problem(HOW?). Any fixes?
A
cached data manageris a red flag in an ASP.NET application.DataSetinstance methods are not thread-safe, so if multiple threads are updating the cached DataSet, all bets are off, and you can expect random “heisenbugs”.Use locking, or even better reconsider the design that caches an updateable DataSet.