You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jg...@apache.org on 2009/10/10 01:34:22 UTC
svn commit: r823741 -
/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
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.
}
}