Deadlocks causing 'Server failed to resume the transaction' with NHibernate and distributed transactions

前端 未结 4 1719
耶瑟儿~
耶瑟儿~ 2021-02-20 00:24

We are having an issue when using NHibernate with distributed transactions.

Consider the following snippet:

//
// There is already an ambient distributed         


        
4条回答
  •  有刺的猬
    2021-02-20 00:34

    This doesn't exactly solve your problem, but you could make your IPreInsertEventListener just send a NSB message, and then have the receiver of the message invoke the stored procedure. I've done that with problematic pre-and post event listeners while using NHibernate and NSB in the past.

    Another thought is have your pre-event listener create its own connection object wrapped in a nice using statement, then it won't touch NHibernate's connection. If it deadlocks, then just do a throw an make sure you've disposed of any object's in scope.

提交回复
热议问题