State is per session.

So far, I have never written a web app where I need to keep the
objects live between request. I always refetch within the new session.
Others may have different experiences.

/Oskar



2010/6/22 nadav s <[email protected]>:
> 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].
>> > 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.
>>
>
> --
> 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.
>

-- 
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