Tôi đang di chuyển một ứng dụng như thế này:NHibernate đuổi theo loại thay vì bằng cách dụ
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);
}
tôi wan't để làm một cái gì đó như thế này:
session.EvictAllByType(typeof(Vehicle));
là nó có thể? làm thế nào ?, cảm ơn
Bạn luôn có thể thực hiện 'session.Clear()' để xóa phiên. –
session.clear() xóa tất cả các đối tượng đã được giao, tôi cần xóa các đối tượng kiểu Vehicle, thanx – manuellt