Exemplo n.º 1
0
		public void OptimisticLocking()
		{
			using (ISession s = OpenSession())
			{
				ObjectWithNullableInt32 obj = new ObjectWithNullableInt32();
				s.Save(obj);
				s.Flush();

				obj.NullInt32 = 1;
				s.Flush();

				obj.NullInt32 = NullableInt32.Default;
				s.Flush();

				s.Delete(obj);
				s.Flush();
			}
		}
Exemplo n.º 2
0
        public void OptimisticLocking()
        {
            using (ISession s = OpenSession())
            {
                ObjectWithNullableInt32 obj = new ObjectWithNullableInt32();
                s.Save(obj);
                s.Flush();

                obj.NullInt32 = 1;
                s.Flush();

                obj.NullInt32 = NullableInt32.Default;
                s.Flush();

                s.Delete(obj);
                s.Flush();
            }
        }
Exemplo n.º 3
0
        public async Task OptimisticLockingAsync()
        {
            using (ISession s = OpenSession())
            {
                ObjectWithNullableInt32 obj = new ObjectWithNullableInt32();
                await(s.SaveAsync(obj));
                await(s.FlushAsync());

                obj.NullInt32 = 1;
                await(s.FlushAsync());

                obj.NullInt32 = NullableInt32.Default;
                await(s.FlushAsync());

                await(s.DeleteAsync(obj));
                await(s.FlushAsync());
            }
        }