[hornetq-commits] JBoss hornetq SVN: r11678 - branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Nov 9 09:36:50 EST 2011


Author: ataylor
Date: 2011-11-09 09:36:50 -0500 (Wed, 09 Nov 2011)
New Revision: 11678

Modified:
   branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
Log:
fix for closing non connected csf

Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java	2011-11-09 10:01:40 UTC (rev 11677)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java	2011-11-09 14:36:50 UTC (rev 11678)
@@ -662,8 +662,17 @@
       addToConnecting(factory);
       try
       {
-         factory.connect(reconnectAttempts, failoverOnInitialConnection);
-         addFactory(factory);
+          try
+          {
+             factory.connect(reconnectAttempts, failoverOnInitialConnection);
+          }
+          catch (HornetQException e1)
+          {
+             //we need to make sure is closed just for garbage collection
+              factory.close();
+              throw e1;
+          }
+          addFactory(factory);
          return factory;
       }
       finally
@@ -675,7 +684,6 @@
    private void removeFromConnecting(ClientSessionFactoryInternal factory)
    {
       connectingFactories.remove(factory);
-      factory.close();
    }
 
    private void addToConnecting(ClientSessionFactoryInternal factory)



More information about the hornetq-commits mailing list