Transaction disposed without explicit rollback / commit

NHibernate Profiler has detected a transaction that was disposed without calling either Commit() or Rollback().

This is a common bug, forgetting to call transaction.Commit() before disposing the session, which results in an implicit rollback. For example:

using(var transaction = session.BeginTransaction())
{
var post = session.Get<Post>(5);
post.AddComment(comment);
}// bug, implicit rollback goes here

Instead of the code above, we should have written:

using(var transaction = session.BeginTransaction())
{
var post = session.Get<Post>(5);
post.AddComment(comment);
transaction.Commit()
}

This piece of code will work and save the new comment. If you want to rollback the transaction, it is recommended that you would do so using an explicit Rollback, since that would be much easier to understand when reading the code late.