i'm using Lock with lock mode none to re attach to the session.
but i'd expect that even if i use update on the aggregate root, the children
that were not modified won't be updated, although they are.
i know about ghost updates, but if i'm not re attaching to a different
session, the not modified children aren't updated
if its by design (attaching to a different session means the state isn't
kept) i get it.
just wanted to ask to be sure i'm not missing something. am i missing
something?

btw, the reason i can't re-fetch the entity is because i have multiple pages
that modify the same model, and only when the save button is hit, it is
actually save.
i know i can use a DTO and only when the save button is hit, re-fetch and
populate the entity with the dto's values

just wanted to know if i can do something else, like use caching or
something to somehow keep the state of the entity through multiple sessions

On Tue, Jun 22, 2010 at 10:27 PM, Fabio Maulo <[email protected]> wrote:

> "it update everything" because I'm using the method session.XYZ
> which is XYZ ?
>
> On Tue, Jun 22, 2010 at 3:20 PM, nadav s <[email protected]> wrote:
>
>> i have a question fin the same topic
>> i'm doing session per request in a web app
>> and noticed that when i re-attach my model to the new session for a new
>> request
>> the dirty checking isn't working properly (it updates everything) and also
>> noticed that in the interceptor, in the find dirty method, the
>> "previousState" comes empty
>>
>> so is the change tracking is infact only within an existing session or am
>> i missing something?
>> and how can this be resolved?
>>
>>
>>
>> On Tue, Jun 22, 2010 at 7:35 PM, Oskar Berggren <[email protected]
>> > wrote:
>>
>>> This is the way I understand it: NH keeps an in-memory-table of the
>>> property values as fetched from the database. Dirty tracking compares
>>> the current property values of tracked objects with the "fetched
>>> state" as found in the "in-memory-table". This does not require
>>> proxies.
>>>
>>> The proxies are there to represent objects that may not yet be loaded
>>> from the DB, but referenced by objects that _are_ loaded. The proxy
>>> will detect an attempt to access it, and then go fetch the true object
>>> from the database.
>>>
>>> Since Get()'s single purpose is to load an object, no proxy is
>>> necessary. Load() will, however, create a proxy.
>>>
>>> /Oskar
>>>
>>>
>>>
>>> 2010/6/22 Joe <[email protected]>:
>>> > Hi All,
>>> >
>>> > I am a bit confused on what session.Get is doing. I always thought
>>> > that Get would return a proxy and that along with the session is how
>>> > change tracking is done.
>>> >
>>> > When I get an object I don't see that a proxy returned, however I do
>>> > see it on Session.Load and on Lazy Loaded associations.
>>> >
>>> > I set dynamic-update = true on the object and still did not get a
>>> > proxy.
>>> >
>>> > So I assume my understanding of session.Get is wrong.
>>> >
>>> > Can anyone provide a bit more insight on how change tracking works? Is
>>> > change tracking only done on the session? How is it tracking changes
>>> > without a proxy?
>>> >
>>> > Thanks in advance,
>>> >
>>> > Joe
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups "nhusers" group.
>>> > To post to this group, send email to [email protected].
>>> > To unsubscribe from this group, send email to
>>> [email protected]<nhusers%[email protected]>
>>> .
>>> > For more options, visit this group at
>>> http://groups.google.com/group/nhusers?hl=en.
>>> >
>>> >
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "nhusers" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<nhusers%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/nhusers?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "nhusers" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<nhusers%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/nhusers?hl=en.
>>
>
>
>
> --
> Fabio Maulo
>
>  --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to