Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 99309 invoked from network); 9 Oct 2009 23:34:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Oct 2009 23:34:51 -0000 Received: (qmail 10996 invoked by uid 500); 9 Oct 2009 23:34:51 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 10939 invoked by uid 500); 9 Oct 2009 23:34:51 -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 10927 invoked by uid 99); 9 Oct 2009 23:34:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Oct 2009 23:34:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Fri, 09 Oct 2009 23:34:43 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9A16223888C2; Fri, 9 Oct 2009 23:34:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r823741 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs Date: Fri, 09 Oct 2009 23:34:22 -0000 To: commits@activemq.apache.org From: jgomes@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091009233422.9A16223888C2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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. } }