Print Page | Close Window

Change Tracking Not Working

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2588
Printed Date: 28-Mar-2025 at 10:37am


Topic: Change Tracking Not Working
Posted By: c63205
Subject: Change Tracking Not Working
Date Posted: 26-Mar-2011 at 10:00pm

I'm having issues where some Entities and change tracking.  When I update the entity's data fields, the entity state remains "unchanged" rather than "modified".  I am not able to reproduce this in another solution yet.

Does anyone know what factors could result in this behavior?



Replies:
Posted By: DenisK
Date Posted: 28-Mar-2011 at 1:51pm
Hi c63205;

An entity's state will change from "modified" to "unchanged" if you have called EntityManager.AcceptChanges, EntityManager.RejectChanges or EntityManager.SaveChanges (or SaveChangesAsync). Maybe you could check if you're calling any of these methods in places you don't intend to.

I can give you better suggestions if you could provide more information on how you're seeing this weird behavior, i.e. what kind of tests or observation that you do that led you to conclude the entity's state remains "unchanged" after an update to the data fields.

And I'm assuming you're not using DevForce POCO's correct?  http://drc.ideablade.com/xwiki/bin/view/Documentation/poco - http://drc.ideablade.com/xwiki/bin/view/Documentation/poco


Posted By: c63205
Date Posted: 28-Mar-2011 at 2:36pm
The state doesnt change the moment i modify the field.  im in the debugger view.  no pocos.  this behavior is sporadic.


Posted By: DenisK
Date Posted: 28-Mar-2011 at 2:43pm
Can you do something similar to below right after you modify the field?

var newState = YourEntity.EntityAspect.EntityState.

Is newState still unchanged?





Print Page | Close Window