activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1096943 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Session.cs
Date Tue, 26 Apr 2011 23:00:13 GMT
Author: tabish
Date: Tue Apr 26 23:00:13 2011
New Revision: 1096943

URL: http://svn.apache.org/viewvc?rev=1096943&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/branches/1.5.x/src/main/csharp/Session.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Session.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Session.cs?rev=1096943&r1=1096942&r2=1096943&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Session.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Session.cs
Tue Apr 26 23:00:13 2011
@@ -308,22 +308,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);



Mime
View raw message