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)
Show replies by date