[seam-commits] Seam SVN: r14126 - branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Jul 15 06:58:15 EDT 2011


Author: manaRH
Date: 2011-07-15 06:58:14 -0400 (Fri, 15 Jul 2011)
New Revision: 14126

Modified:
   branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java
Log:
JBPAPP-6842 adding patch for ServerConversationContext.flush()

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java	2011-07-13 14:04:37 UTC (rev 14125)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java	2011-07-15 10:58:14 UTC (rev 14126)
@@ -289,18 +289,22 @@
               session.remove(getKey(name));
           }
           removals.clear();
-          // TODO this is a hack! We should find a more elegant way of handling
-          // new objects being added to additions during the following for-loop
-          PersistenceContexts.instance();
           
-          //add new objects
-          for (Map.Entry<String, Object> entry: additions.entrySet())  {
-              Object attribute = entry.getValue();
-              
-              passivate(attribute); 
-              session.put(getKey(entry.getKey()), attribute);
+          // Nothing to do if there is no addition
+          if (!additions.isEmpty()) {
+             // TODO this is a hack! We should find a more elegant way of handling
+             // new objects being added to additions during the following for-loop
+             PersistenceContexts.instance();
+             
+             //add new objects
+             for (Map.Entry<String, Object> entry: additions.entrySet())  {
+                 Object attribute = entry.getValue();
+                 
+                 passivate(attribute); 
+                 session.put(getKey(entry.getKey()), attribute);
+             }
+             additions.clear();             
           }
-          additions.clear();
       }
       else
       {



More information about the seam-commits mailing list