public void ConnectionMaintanenceDuringFlush()
		{
			Prepare();
			ISession s = GetSessionUnderTest();
			s.BeginTransaction();

			IList<Silly> entities = new List<Silly>();
			for (int i = 0; i < 10; i++)
			{
				Other other = new Other("other-" + i);
				Silly silly = new Silly("silly-" + i, other);
				entities.Add(silly);
				s.Save(silly);
			}
			s.Flush();

			foreach (Silly silly in entities)
			{
				silly.Name = "new-" + silly.Name;
				silly.Other.Name = "new-" + silly.Other.Name;
			}
//			long initialCount = sessions.Statistics.getConnectCount();
			s.Flush();
//			Assert.AreEqual(initialCount + 1, sessions.Statistics.getConnectCount(), "connection not maintained through Flush");

			s.Delete("from Silly");
			s.Delete("from Other");
			s.Transaction.Commit();
			Release(s);
			Done();
		}
예제 #2
0
		public Silly(string name, Other other)
		{
			this.name = name;
			this.other = other;
		}
예제 #3
0
 public Silly(string name, Other other)
 {
     this.name  = name;
     this.other = other;
 }