public void ContextCleanup() { ISession session = sessions.GetCurrentSession(); session.BeginTransaction(); session.Transaction.Commit(); Assert.IsFalse(session.IsOpen, "session open after txn completion"); Assert.IsFalse(TestableThreadStaticContext.IsSessionBound(session), "session still bound after txn completion"); ISession session2 = sessions.GetCurrentSession(); Assert.IsFalse(session.Equals(session2), "same session returned after txn completion"); session2.Close(); Assert.IsFalse(session2.IsOpen, "session open after closing"); Assert.IsFalse(TestableThreadStaticContext.IsSessionBound(session2), "session still bound after closing"); }
public TestableThreadStaticContext(ISessionFactoryImplementor factory) : base(factory) { me = this; }