This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
We have a job which updates 1000's of records, but to avoid delays, we update all the entities first, then perfomr a single uow.SaveChanges. This works fine, unless the last record has a problem, i.e. a missing reference record. So my question is, is there a property or something I can set, so that if it encounters any SQL errors, that instead of throwing an error, it simply continues the save with the non-problematic records?
|
|
|
No, there is no such option. Although it sounds attractive, we're unlikely to be able to add it, because updates are batched -- that is, each database command contains multiple SQL statements updating or inserting multiple entities. If an exception occurs in any statement in a batch, then nothing in the batch gets applied to the database. If we were to continue the save, you would find that not only had the problematic record failed to save, so so had UpdateBatchSize - 1] valid records, seemingly at random. |
|