The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Save entity, attached to collection, modify entity = collection not dirty - make sense?

Last post 09-10-2008, 7:13 AM by Mike.Griffin. 10 replies.
Sort Posts: Previous Next
  •  05-02-2008, 6:44 PM 9166

    Save entity, attached to collection, modify entity = collection not dirty - make sense?

    I'm in the very early stages of finding a bug in my application.  While hunting I noticed something a little strange;

    1. If I new up an entity as a standalone
    2. set it's properties
    3. save (as standalone)
    4. attach to an existing collection
    5. get a reference to the entity that has been added to the collection
    6. change properties

    the collections IsDirty property remains false.

    I haven't done any exhaustive testing yet, but it does seem to be the case.  Before I spend 2 hours proving (or disproving) this with a simple example can anyone chime in if they have experienced this or if the ES guys can imagine how this might be possible? 

    Filed under: ,
  •  05-02-2008, 7:34 PM 9167 in reply to 9166

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    I banged out a quick test application and can't reproduce the problem.

    This is very strange, I can't imagine under what circumstances I could modify an object in the collection and have the collection still think it's not dirty.

    This only happens with the object that I add to the collection by calling AttachEntity().

     

    Can you guys think of anything at all that I could try? 

  •  05-02-2008, 7:34 PM 9168 in reply to 9166

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    I would say you have probably found a bug, I will unit test it this weekend and get a fix in ES2008 if it turns out to be a bug. AttachEntity is not as simple as it sounds, it has to add it's row to the main DataTables and such, we must have missed something in there as far a the dirty flags goes.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  05-02-2008, 7:53 PM 9169 in reply to 9168

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    Mike, did you see that I *could not* reproduce the problem?  I would agree, it would be a bug if I could reproduce it, but....

     

  •  08-13-2008, 7:45 AM 10723 in reply to 9169

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    I'm back.  I had left this issue alone to move on to other things but it's now under the spotlight again as other people have noticed it here in the office.

    What can we do to work on this? 

  •  08-13-2008, 11:43 AM 10733 in reply to 10723

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    Have you been able to reproduce it in your test app, yet? Do you see any commonality in the code where it occurs vs. code where it does not?
    David Neal Parsons
    www.entityspaces.net
  •  09-09-2008, 9:28 PM 11263 in reply to 10733

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    David.Parsons:
    Have you been able to reproduce it in your test app, yet? Do you see any commonality in the code where it occurs vs. code where it does not?

    I haven't been able to reproduce in the test app and I completely realize how important it is that I do.  I will take another stab (duplicate entire project and start ripping it down) at getting a reproducible and sharable app for your review.  As a temp workaround I added a "Reload Data" button which will allow my users to keep working without restarting the application.  It's better than crashes!  Geeked
     

  •  09-10-2008, 5:49 AM 11271 in reply to 11263

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    Before you spend a lot of time trying to reproduce an intermittent error in an older version of ES, you should be aware that in the latest beta versions, there has been significant refactoring of Core and all providers. This has improved performance on saves significantly. It also affects, internally, how we handle the ModifiedColumns collection, IsDirty, and RowState. In fact, in addition to the regression tests we had, we added an entire TestFixture devoted to integration tests that test the status of those properties under a variety of conditions (adds, updates, deletes, RejectChanges, etc.), and combinations of conditions for both entities and collections.
    David Neal Parsons
    www.entityspaces.net
  •  09-10-2008, 6:28 AM 11273 in reply to 11271

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    Definitely agree with David, the new version (beta) is smokin' fast and the IsDirty logic has been totally redone.
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  09-10-2008, 6:37 AM 11274 in reply to 11273

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    OK guys, I'll give the new version a shot before spending time on a test application, thanks for letting me know things are improved.

    Is this a beta version you are referring to or the 2008 release? 

  •  09-10-2008, 7:13 AM 11275 in reply to 11274

    Re: Save entity, attached to collection, modify entity = collection not dirty - make sense?

    Grab the latest beta, another one will be out in a few days, we're almost at the final release of this maintenance release.
    EntitySpaces | Twitter | BLOG | Please honor our Software License
View as RSS news feed in XML