”A problem” might be a too strong word but… It fooled me. I didn’t know that the connection was closed when a transaction was committed, because…
using(ISession session = OpenSession())
{
using(ITransaction tx = session.BeginTransaction())
{
[...]
tx.Commit();
}
Assert.IsFalse(session.IsConnected);
Assert.AreEqual(ConnectionState.Closed, session.Connection.State);
}
…none of these asserts are ok. The first one fails due to the “ownConnection” field is true, the second assert fails due to this “implicit” instantiation of a new connection.
But never mind… Now I know what I didn’t understand J