New Posts New Posts RSS Feed: Remove Entity from PM
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Remove Entity from PM

 Post Reply Post Reply
Author
japal View Drop Down
Newbie
Newbie


Joined: 27-Aug-2008
Posts: 2
Post Options Post Options   Quote japal Quote  Post ReplyReply Direct Link To This Post Topic: Remove Entity from PM
    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.
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
japal View Drop Down
Newbie
Newbie


Joined: 27-Aug-2008
Posts: 2
Post Options Post Options   Quote japal Quote  Post ReplyReply Direct Link To This Post Posted: 28-Aug-2008 at 12:15am
Thanks for your quick reply,
The solution was to remove my subscription to the PropertyChanged event.
 
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down