From: <aye...@us...> - 2009-01-09 12:56:07
|
Revision: 3981 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3981&view=rev Author: ayenderahien Date: 2009-01-09 11:49:30 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Adding logging for DTC operations 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-01-08 16:21:22 UTC (rev 3980) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-01-09 11:49:30 UTC (rev 3981) @@ -17,6 +17,8 @@ namespace NHibernate.Impl { + using log4net; + /// <summary> Functionality common to stateless and stateful sessions </summary> [Serializable] public abstract class AbstractSessionImpl : ISessionImplementor, IEnlistmentNotification @@ -28,6 +30,8 @@ private bool isAlreadyDisposed; protected bool shouldCloseSessionOnDtcTransactionCompleted; + private static readonly ILog logger = LogManager.GetLogger(typeof (AbstractSessionImpl)); + protected bool TakingPartInDtcTransaction { get @@ -259,10 +263,12 @@ Flush(); } preparingEnlistment.Prepared(); + logger.Debug("prepared for DTC transaction"); } void IEnlistmentNotification.Commit(Enlistment enlistment) { + logger.Debug("committing DTC transaction"); // we have nothing to do here, since it is the actual // DB connection that will commit the transaction enlistment.Done(); @@ -271,12 +277,14 @@ void IEnlistmentNotification.Rollback(Enlistment enlistment) { AfterTransactionCompletion(false, null); + logger.Debug("rolled back DTC transaction"); enlistment.Done(); } void IEnlistmentNotification.InDoubt(Enlistment enlistment) { AfterTransactionCompletion(false, null); + logger.Debug("DTC transaction is in doubt"); enlistment.Done(); } @@ -287,6 +295,7 @@ if (System.Transactions.Transaction.Current==null) return; ambientTransation = System.Transactions.Transaction.Current; + logger.Debug("enlisted into DTC transaction"); 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. |