예제 #1
0
        public void WithHeldTransactionDoesNotCommitParent()
        {
            Parent p = new Parent();

            p.Name = "Joe";
            With.AutoRollbackTransaction(delegate()
            {
                session.Save(p);
                session.Flush();
                session.Clear();
                Parent p2 = session.Get <Parent>(p.Id);
                Assert.IsNotNull(p2);
            });
            session.Clear();
            Parent p3 = session.Get <Parent>(p.Id);

            Assert.IsNull(p3);
        }