Print Page | Close Window

Remove Entity from PM

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=924
Printed Date: 28-Mar-2025 at 5:16pm


Topic: Remove Entity from PM
Posted By: japal
Subject: Remove Entity from PM
Date Posted: 27-Aug-2008 at 4:51am
How do I remove en entity from the PM cache when the entity is in an added rowstate?
I end up with a RowNotInTableException.



Replies:
Posted By: davidklitzke
Date Posted: 27-Aug-2008 at 6:46am
It is likely that you actually have removed the entity from the cache, but you are getting an exception because somewhere in your application you still have a reference to the deleted entity.  Be especially careful that the deleted entity has been deleted from all EntityLists before you try to delete the entity.


Posted By: japal
Date Posted: 28-Aug-2008 at 12:15am
Thanks for your quick reply,
The solution was to remove my subscription to the PropertyChanged event.
 


Posted By: davidklitzke
Date Posted: 28-Aug-2008 at 11:10am
Japal.
 
Congratulations.  I was going to add that the problem was not likely to caused by a reference in an EntityList because in V3, references to deleted entities are automatically removed by DevForce unless you�ve explicitly set the ShouldRemoveDeletedEntities property on the EntityList to false (it defaults to true). 
 
David



Print Page | Close Window