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(); } }
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(); } }
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()); } }