public void FilterOnOffOn()
		{
			var c = new Category { Code = "2600", Deleted = true };
			SaveCategory(c);

			using (ISession s = OpenSession())
			{
				s.EnableFilter("state").SetParameter("deleted", false);

				IList<Category> result =
					s.CreateQuery("from Category where Code = :code").SetParameter("code", "2600").List<Category>();

				Assert.That(result.Count == 0);
			}

			using (ISession s = OpenSession())
			{
				IList<Category> result =
					s.CreateQuery("from Category where Code = :code").SetParameter("code", "2600").List<Category>();

				Assert.That(result.Count > 0);
			}

			using (ISession s = OpenSession())
			{
				s.EnableFilter("state").SetParameter("deleted", true);

				IList<Category> result =
					s.CreateQuery("from Category where Code = :code").SetParameter("code", "2600").List<Category>();

				Assert.That(result.Count > 0);
			}

			Cleanup();
		}
		private void SaveCategory(Category c)
		{
			using (ISession s = OpenSession())
			{
				using (ITransaction tx = s.BeginTransaction())
				{
					s.Save(c);
					tx.Commit();
				}
			}
		}
		public void Bug()
		{
			var c = new Category { Code = "2600", Deleted = false };
			SaveCategory(c);

			// exec queries, twice, different session
			ExecQuery();
			ExecQuery();

			// cleanup using filter
			using (ISession s = OpenSession())
			{
				using (ITransaction tx = s.BeginTransaction())
				{
					s.EnableFilter("state").SetParameter("deleted", false);
					s.Delete("from Category");
					tx.Commit();
				}
			}
		}