Yes, you would not want to use it for that reason, flush will do that
automatically. Unfortunately I do sometimes crave for a way to see
which objects are in the session. Sometimes I would want to evict all
objects of a certain type from the session cache. This if you have a
longer running session and someone else has updated the DB values.
There is no known way of evicting say all purchase info and then re-
run a query to load the relevant ones. If you don't evict them then
you get a strange mix of stale and current information as your query
result (even when having the version number available!)

On Aug 16, 3:33 pm, Jason Dentler <[email protected]> wrote:
> Automatic dirty checking will take care of this when the session is flushed
> (which normally happens when you commit a transaction)
>
>
>
> On Mon, Aug 16, 2010 at 4:27 AM, Jacob Madsen <[email protected]> wrote:
> > Hi all,
>
> > Is there a method to retrieve references to all entities known by a
> > session
>
> > using (var session = sessionFactory.OpenSession())
> > {
> >    var entity = session.Get<SomeType>(someId); // "entity" is now
> > known by the session
> >    ....
> >    var allKnownEntities = /* here I want to retrieve all entities
> > known/attached to a session */
> >    ....
> > }
>
> > I want to implement a "void SaveChanges()" method that will Update all
> > modified entities known by a session.
>
> > Cheers!
>
> > --
> > 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.- Hide quoted text -
>
> - Show quoted text -

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