[seam-commits] Seam SVN: r9198 - trunk/src/main/org/jboss/seam/contexts.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sun Oct 5 22:13:52 EDT 2008
Author: shane.bryzak at jboss.com
Date: 2008-10-05 22:13:52 -0400 (Sun, 05 Oct 2008)
New Revision: 9198
Modified:
trunk/src/main/org/jboss/seam/contexts/ServerConversationContext.java
Log:
JBSEAM-3512
Modified: trunk/src/main/org/jboss/seam/contexts/ServerConversationContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/contexts/ServerConversationContext.java 2008-10-05 23:09:40 UTC (rev 9197)
+++ trunk/src/main/org/jboss/seam/contexts/ServerConversationContext.java 2008-10-06 02:13:52 UTC (rev 9198)
@@ -25,6 +25,7 @@
* may be passivated or replicated.
*
* @author Gavin King
+ * @author Shane Bryzak
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
*/
public class ServerConversationContext implements Context
@@ -291,13 +292,24 @@
removals.clear();
//add new objects
- for (Map.Entry<String, Object> entry: additions.entrySet()) {
- Object attribute = entry.getValue();
-
- passivate(attribute);
- session.put(getKey(entry.getKey()), attribute);
+ while (!additions.isEmpty())
+ {
+ // Copy the additions entries to a temporary variable, then
+ // clear additions - during passivation, further attributes may
+ // be set in the conversation context so we need to re-iterate
+ // through this process until all additions are passivated
+ Set<Map.Entry<String,Object>> entries = new HashSet<Map.Entry<String,Object>>(additions.entrySet());
+ additions.clear();
+
+ for (Map.Entry<String, Object> entry: entries)
+ {
+ Object attribute = entry.getValue();
+
+ passivate(attribute);
+ session.put(getKey(entry.getKey()), attribute);
+ }
}
- additions.clear();
+
}
else
{
More information about the seam-commits
mailing list