[seam-commits] Seam SVN: r13244 - in branches/enterprise/JBPAPP_4_3_FP01/src: test/integration/src/org/jboss/seam/test/integration and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Jun 18 08:45:50 EDT 2010


Author: manaRH
Date: 2010-06-18 08:45:50 -0400 (Fri, 18 Jun 2010)
New Revision: 13244

Modified:
   branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java
   branches/enterprise/JBPAPP_4_3_FP01/src/test/integration/src/org/jboss/seam/test/integration/EntityPassivationTest.java
Log:
JBPAPP-4492 - fixed integration tests with old hack

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	2010-06-18 12:20:30 UTC (rev 13243)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java	2010-06-18 12:45:50 UTC (rev 13244)
@@ -18,6 +18,7 @@
 import org.jboss.seam.Seam;
 import org.jboss.seam.core.Events;
 import org.jboss.seam.core.Manager;
+import org.jboss.seam.persistence.PersistenceContexts;
 
 /**
  * A conversation context is a logical context that lasts longer than 
@@ -288,23 +289,18 @@
               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
-          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);
-             }
+          for (Map.Entry<String, Object> entry: additions.entrySet())  {
+              Object attribute = entry.getValue();
+              
+              passivate(attribute); 
+              session.put(getKey(entry.getKey()), attribute);
           }
+          additions.clear();
       }
       else
       {

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/test/integration/src/org/jboss/seam/test/integration/EntityPassivationTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/integration/src/org/jboss/seam/test/integration/EntityPassivationTest.java	2010-06-18 12:20:30 UTC (rev 13243)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/integration/src/org/jboss/seam/test/integration/EntityPassivationTest.java	2010-06-18 12:45:50 UTC (rev 13244)
@@ -1,5 +1,6 @@
 package org.jboss.seam.test.integration;
 
+import java.io.Serializable;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -95,7 +96,7 @@
     @Name("entitytest.someComponent")
     @Scope(ScopeType.CONVERSATION)
     @AutoCreate
-    public static class SomeComponent {
+    public static class SomeComponent implements Serializable{
         @In EntityManager entityManager;
         
         



More information about the seam-commits mailing list