activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r823741 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
Date Fri, 09 Oct 2009 23:34:22 GMT
Author: jgomes
Date: Fri Oct  9 23:34:22 2009
New Revision: 823741

URL: http://svn.apache.org/viewvc?rev=823741&view=rev
Log:
Improved try/catch of exceptions when disposing of connection objects.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs?rev=823741&r1=823740&r2=823741&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs Fri Oct
 9 23:34:22 2009
@@ -432,31 +432,31 @@
 
 		public void DisposeOf(DataStructure objectId)
 		{
-			RemoveInfo command = new RemoveInfo();
-			command.ObjectId = objectId;
-			if(asyncClose)
+			try
 			{
-				Tracer.Info("Asynchronously disposing of Connection.");
-				if(connected)
+				RemoveInfo command = new RemoveInfo();
+				command.ObjectId = objectId;
+				if(asyncClose)
 				{
-					command.ResponseRequired = false;
-					transport.Oneway(command);
+					Tracer.Info("Asynchronously disposing of Connection.");
+					if(connected)
+					{
+						command.ResponseRequired = false;
+						transport.Oneway(command);
+					}
 				}
-			}
-			else
-			{
-				// Ensure that the object is disposed to avoid potential race-conditions
-				// of trying to re-create the same object in the broker faster than
-				// the broker can dispose of the object.  Allow up to 5 seconds to process.
-				try
+				else
 				{
+					// Ensure that the object is disposed to avoid potential race-conditions
+					// of trying to re-create the same object in the broker faster than
+					// the broker can dispose of the object.  Allow up to 5 seconds to process.
 					Tracer.Info("Synchronously disposing of Connection.");
 					SyncRequest(command, TimeSpan.FromSeconds(5));
 				}
-				catch // (BrokerException)
-				{
-					// Ignore exceptions while shutting down.
-				}
+			}
+			catch // (BrokerException)
+			{
+				// Ignore exceptions while shutting down.
 			}
 		}
 



Mime
View raw message