Using NHibernate, in my NUnit tests I might make a call such as session.Delete(_user)
where _user
is a persistent object.
My problem seems to be that unless I have this and any other updates included within a transaction, it never succeeds.
So,
CurrentSessionContext.Bind(GetHibernateSessionFactory().OpenSession());
ITransaction trans=session.BeginTransaction()
session.Delete(_user);
trans.Commit();
CurrentSessionContext.Unbind(GetHibernateSessionFactory())
works.
but,
CurrentSessionContext.Bind(GetHibernateSessionFactory().OpenSession());
session.Delete(_user);
CurrentSessionContext.Unbind(GetHibernateSessionFactory())
doesn't, yet there are no exceptions or problems being reported.
Any ideas?