Welcome to the CodeSmith Community!

Re: How EntityTracking works

.netTiers

A description has not yet been added to this group.

How EntityTracking works

  • rated by 0 users
  • This post has 5 Replies |
  • 2 Followers
  • I'd like to have an explanation or documenation that explains how entity tracking works.

     

    For example, when does the instance of a particular entity get's "disposed"? remove from the tracking? When does the entityfactory returns a new instance. I assume that an entity can't always live.

     

    I guess, it should be something like when the entity is no longer being referenced, it should not be tracked? If I do a Get<Entity> it should return a new instance ..... if so how doesn't it know when to return a new instance ?

  • Hi,

    Check this out:  Entity Management

    It appears to address your questions. 

     

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com

  • Thanks,

     

    quote " we will return to you the same object for all references until that entity is persisted to the DataRepository "

     

    Does that mean, that until the entity is not saved, it will return the same instance ?

  • I looked in the code and in fact it stop tracking in the update of the entity

     

                if (DataRepository.Provider.EnableEntityTracking)
                    EntityManager.StopTracking(entity.EntityTrackingKey);

  • Simply put: It doesn't...lol

     

    Turn it off.

  • Yea, I tend to agree with vbandrade on this one. 

    <rant>

    People have tried to explain to me why they use this feature and I understand there is a "purpose" for it......but EntityTracking in nettiers is not efficient.  it still executes the Sql.  It has to execute the Sql to know what the "expected" result of the Query are.  Think about that......follow it through.  EntityTracking is saving you NO time....it purely there to try and keep 1 instance of a particular entity shared amongst many callers.  But....then that dies anyway once you bring in distributed systems.  Maybe I am just having a hard time understanding the "why" on this one...the stuborn side of me.

    I could go on and on....I guess that is why you can turn it off!!

    </rant>

    I am pretty sure that EntityTracking also may time out based on your EntLib configuration??  Doesn't it use Entlib caching block for this?

    Also, there were alot of changes put into Nettiers 2.3 to "fix" the entity tracking stuff.  Before 2.3.....sadly...I don't even think it was caching the stuff correctly.

    jeff

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

Page 1 of 1 (6 items)