によって私はこのようなアプリケーションを移行しています:NHibernateは立ち退かせることによってタイプの代わりに、インスタンス
Vehicle v = null;
using (ISession session = MyNHibernateSession())
{
v = Vehicle.FindById(1);
}
using (ISession session = MyNHibernateSession())
{
// somwwhere into these4 lines Vehicle comes Finded
DoSomething();
DoSomething2();
DoSomething3();
DoSomething4();
DoSomething5();
DoSomething6();
// if i do this i get an error "another object with the same id etc etc etc
session.Update(v);
}
私はこのような何かを行うにwan't:
session.EvictAllByType(typeof(Vehicle));
が、それは可能ですか?どのように?、 ありがとう
セッションをクリーンアップするには、いつでも 'session.Clear()'を実行できます。 –
session.clear()セッションオブジェクトをクリアする必要があります。車種オブジェクト、thanx – manuellt