Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> Entity is dirty after refetching
 

Pages: 1
Bugs & Issues
Entity is dirty after refetching
Page:1/1 

  Print all messages in this thread  
Poster Message
TomV
User



Location:
Belgium
Joined on:
31-Jan-2008 14:22:10
Posted:
76 posts
# Posted on: 02-Jun-2009 13:18:09.  
Hi Otis,

This thread was based on our conversation from thread
http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=14195

I'll try to describe our "problem".

We have a problem with wrong behavior of IsDirty property of entitiy. We have DeviceEntity in hierarchy with it’s DeviceParentEntity in an optional PK-FK relationship. While we create new DeviceEntity we set DeviceParenId for proper value. The problem is when we open second instance of form which visulizes Devices data this new added Device is dirty.

I did something like this while adding new Device:

Code:

Main.DataServer.SaveEntity<DeviceEntity>(Main.Token, newDevice, true, true);
newDevice = Main.DataServer.FetchEntity(newDevice, PrefetchPath) as DeviceEntity;
Main.Context.Add(newDevice);


So this new added Device is now in Context. Entity now is not dirty. After that I opened second instance of this Devices form and after fetching data the last added Device was dirty. To be accurate: DeviceParentId field was changed (IsChanged was true) but CurrentValue had same value as DbValue.

We think this could be wrong behavior as after fetch from DB entity becomes dirty.

Kind regards,
TomV
Life goes fast, it must be riding a Ducati!  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14569 posts
# Posted on: 03-Jun-2009 10:07:38.  
Quote:
To be accurate: DeviceParentId field was changed (IsChanged was true) but CurrentValue had same value as DbValue.

This sounds like the core of it.
Which LLBLGen Pro runtime library version are you using?


  Top
TomV
User



Location:
Belgium
Joined on:
31-Jan-2008 14:22:10
Posted:
76 posts
# Posted on: 03-Jun-2009 10:11:06.  
Hi Walaa,

Due to a copy and paste error while creating the post for the forum, the version was not in the post, sorry for this.

I first used the runtime 28th of october 2008, but Otis asked me to use the latest runtime, so I switched to the runtime of 12th of May 2009.

Regards,
TomV
Life goes fast, it must be riding a Ducati!  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14569 posts
# Posted on: 03-Jun-2009 10:27:17.  
Quote:
To be accurate: DeviceParentId field was changed (IsChanged was true) but CurrentValue had same value as DbValue.

The important thing is: Did the CurrentValue change? regardless of the DBValue.
If yes then IsChanged pf the field should be true and then IsDirty too.


  Top
TomV
User



Location:
Belgium
Joined on:
31-Jan-2008 14:22:10
Posted:
76 posts
# Posted on: 03-Jun-2009 10:41:59.  
Hi Walaa,

I will add a trace message in the OnSetValue method and log all values for the DeviceParentId to see if I (or my code) might changed the value in between and might have triggered the IsChanged by doing this.

Unfortunately I don't have any spare time in my current sprint to test this out. I hope you can understand this.

I don't know what you prefer, that I close this thread now and reopen it when my next sprint has started or that the thread stays open?

Kind regards,
TomV
Life goes fast, it must be riding a Ducati!  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14569 posts
# Posted on: 03-Jun-2009 10:54:35.  
Better to close it for now (I'll close it).
And once you post a reply it will be automatically re-opened.

Thanks.


  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.