Deadlocks causing 'Server failed to resume the transaction' with NHibernate and distributed transactions
问题 We are having an issue when using NHibernate with distributed transactions. Consider the following snippet: // // There is already an ambient distributed transaction // using(var scope = new TransactionScope()) { using(var session = _sessionFactory.OpenSession()) using(session.BeginTransaction()) { using(var cmd = new SqlCommand(_simpleUpdateQuery, (SqlConnection)session.Connection)) { cmd.ExecuteNonQuery(); } session.Save(new SomeEntity()); session.Transaction.Commit(); } scope.Complete(); }