Can I avoid having ORMConcurrencyException thrown when entities don't exist?

Posts   
 
    
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 07-May-2008 02:39:47   

I have a situation where I really would like to avoid having ORMConcurrencyException thrown during an update if the entities don't exist anymore. (I know someone will ask why, but just take my word for it).

I know I can loop through all the entities and manually check each one to see if it still exists before updating, but it'd be a lot simpler if I could just let the updates silently fail if they don't exist anymore. Is that possible?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 07-May-2008 10:25:18   

I can see no other way to do it except building your own version of the ORMSupportClasses...dll

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 07-May-2008 19:24:35   

Ok, I understand the reasoning for it, but in my case I am saving off some data, then deleting and repopulating those tables, then saving back the data - but some of those records may no longer exist, in which case I don't care.

No problem, I'll just have to manually verify which records still exist before doing the update.

Thanks.