From: <aye...@us...> - 2009-03-24 11:27:28
|
Revision: 4152 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4152&view=rev Author: ayenderahien Date: 2009-03-24 11:27:18 +0000 (Tue, 24 Mar 2009) Log Message: ----------- cloning and disposing of the ambient transaction, instead of using the current one. This protects us from bugs in the framework that dispose the transaction early. Fixed NH-1676 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-03-24 10:59:04 UTC (rev 4151) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-03-24 11:27:18 UTC (rev 4152) @@ -190,6 +190,15 @@ protected internal void SetClosed() { + try + { + if (ambientTransation != null) + ambientTransation.Dispose(); + } + catch (Exception) + { + //ignore + } closed = true; } @@ -310,7 +319,7 @@ return; if (System.Transactions.Transaction.Current==null) return; - ambientTransation = System.Transactions.Transaction.Current; + ambientTransation = System.Transactions.Transaction.Current.Clone(); logger.DebugFormat("enlisted into DTC transaction: {0}", ambientTransation.IsolationLevel); AfterTransactionBegin(null); ambientTransation.TransactionCompleted += delegate(object sender, TransactionEventArgs e) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |