Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 102BB163B for ; Tue, 26 Apr 2011 22:53:40 +0000 (UTC) Received: (qmail 17305 invoked by uid 500); 26 Apr 2011 22:53:40 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 17278 invoked by uid 500); 26 Apr 2011 22:53:40 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 17271 invoked by uid 99); 26 Apr 2011 22:53:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2011 22:53:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2011 22:53:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id ACBDF2388901; Tue, 26 Apr 2011 22:53:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1096941 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs Date: Tue, 26 Apr 2011 22:53:16 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110426225316.ACBDF2388901@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Tue Apr 26 22:53:16 2011 New Revision: 1096941 URL: http://svn.apache.org/viewvc?rev=1096941&view=rev Log: fix for: https://issues.apache.org/jira/browse/AMQNET-326 Don't do anything with TX locking if not in a TX when close is entered. Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs?rev=1096941&r1=1096940&r2=1096941&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Session.cs Tue Apr 26 22:53:16 2011 @@ -299,22 +299,23 @@ namespace Apache.NMS.ActiveMQ } try - { - TransactionContext.SyncRoot.WaitOne(); - + { if (transactionContext.InNetTransaction) { - TransactionContext.SyncRoot.ReleaseMutex(); + TransactionContext.SyncRoot.WaitOne(); - // Must wait for all the DTC operations to complete before - // moving on from this close call. - this.transactionContext.DtcWaitHandle.WaitOne(); + if (transactionContext.InNetTransaction) + { + // Must wait for all the DTC operations to complete before + // moving on from this close call. + TransactionContext.SyncRoot.ReleaseMutex(); + this.transactionContext.DtcWaitHandle.WaitOne(); + TransactionContext.SyncRoot.WaitOne(); + } - TransactionContext.SyncRoot.WaitOne(); + TransactionContext.SyncRoot.ReleaseMutex(); } - TransactionContext.SyncRoot.ReleaseMutex(); - Tracer.InfoFormat("Closing The Session with Id {0}", this.info.SessionId); DoClose(); Tracer.InfoFormat("Closed The Session with Id {0}", this.info.SessionId);