Read the last section of this section on the manual; http://nhforge.org/doc/nh/en/index.html#manipulatingdata-loading
It is possible to re-load an object and all its collections at any time, > using the Refresh() method. <http://nhforge.org/doc/nh/en/index.html#manipulatingdata-loading> session.Refresh(object); will do the trick. Other wise you can evict and then executes get, read the section "Managing the caches": http://nhforge.org/doc/nh/en/index.html#performance-sessioncache you can do something like: session.Evict(typeof(YourEntity), id); session.Get<YourEntity>(id); P.S. I've worked on three large scale projects with nhibernate, and other few small projects, and i've ever never need to call Evict, and i think i've never used Refresh. So, i am wondering if you are managing your session properly. 2011/1/6 Joseph Lam <[email protected]> > I've created this improvement request: > http://216.121.112.228/browse/NH-2494 > > Basically I would like to have a way of making sure that an object > retrieved from ISession is fresh from the DB, and not from the session > cache. At the moment is the only fine-grained mechanism to selectively > bypass session cache on a per-object basis is the Evict() method which > is not always feasible when the caller does not have reference to a > previously retrieved instance. > > -- > 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.
