You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2011/04/27 01:00:13 UTC
svn commit: r1096943 -
/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Session.cs
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);