[hornetq-commits] JBoss hornetq SVN: r9415 - 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 09:37:16 EDT 2010


Author: jmesnil
Date: 2010-07-19 09:37:15 -0400 (Mon, 19 Jul 2010)
New Revision: 9415

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

* in close(), copy the sessions set to prevent a ConcurrentModificationException

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 13:36:15 UTC (rev 9414)
+++ branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java	2010-07-19 13:37:15 UTC (rev 9415)
@@ -396,7 +396,8 @@
       {
          synchronized (failoverLock)
          {
-            for (ClientSession session : sessions)
+            // work on a copied set. the session will be removed from sessions when session.close() is called
+            for (ClientSession session : new HashSet<ClientSession>(sessions))
             {
                try
                {



More information about the hornetq-commits mailing list