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();
		}
Ejemplo n.º 2
0
		public Silly(string name, Other other)
		{
			this.name = name;
			this.other = other;
		}
Ejemplo n.º 3
0
 public Silly(string name, Other other)
 {
     this.name  = name;
     this.other = other;
 }