[hornetq-commits] JBoss hornetq SVN: r9410 - branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jul 19 08:10:34 EDT 2010


Author: jmesnil
Date: 2010-07-19 08:10:34 -0400 (Mon, 19 Jul 2010)
New Revision: 9410

Modified:
   branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
Log:
HA refactoring

* do not close the underlying connection until close() is called

Modified: branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java	2010-07-19 12:09:09 UTC (rev 9409)
+++ branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java	2010-07-19 12:10:34 UTC (rev 9410)
@@ -356,8 +356,6 @@
          synchronized (failoverLock)
          {
             sessions.remove(session);
-
-            checkCloseConnection();
          }
       }
    }
@@ -394,6 +392,26 @@
          return;
       }
 
+      synchronized (createSessionLock)
+      {
+         synchronized (failoverLock)
+         {
+            for (ClientSession session : sessions)
+            {
+               try
+               {
+                  session.close();
+               }
+               catch (HornetQException e)
+               {
+                  log.warn("Unable to close session", e);
+               }
+            }
+
+            checkCloseConnection();
+         }
+      }
+
       causeExit();
 
       closed = true;



More information about the hornetq-commits mailing list