Hi,

The follow TEST doesn't throw an exception but we are doing a query outside of a transaction. Why ?

[TestMethod, TestCategory("SessionOptions.NotTransactionRead")]
[ExpectedException(typeof(Exception))]
public void TestTransactionRollbackThenQueryWithoutOpenedTransaction()
{
  Domain domain = TestUtils.CreateDomain(SessionOptions.ValidateEntities | SessionOptions.AutoActivation | SessionOptions.AutoSaveChanges);
  using (Session session = domain.OpenSession())
  {
    using (TransactionScope t = session.OpenTransaction())
    {
      new TestEntity();
    }
    Assert.IsTrue(!Query.All<TestEntity>().Any(), "TestEntity should not be created because transaction wasn't completed");
  }
  domain.Dispose();
}

asked Jun 02 '17 at 10:57

Benoit%20Nesme's gravatar image

Benoit Nesme
43202024


One Answer:

Hello Benoit Nesme,

Thank you for the report. The bug is confirmed and fixed in developing branch. The next release will contain the fix.

answered Jun 02 '17 at 11:49

Alexey%20Kulakov's gravatar image

Alexey Kulakov
77225

edited Jun 02 '17 at 12:05

Thanks Alexey

(Jun 06 '17 at 02:31) Benoit Nesme Benoit%20Nesme's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA