[seam-commits] Seam SVN: r14129 - branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/contexts.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Jul 19 06:04:52 EDT 2011
Author: manaRH
Date: 2011-07-19 06:04:52 -0400 (Tue, 19 Jul 2011)
New Revision: 14129
Modified:
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/contexts/ServerConversationContext.java
Log:
JBPAPP-6751 creating PC only if they needed for additions
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/contexts/ServerConversationContext.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/contexts/ServerConversationContext.java 2011-07-19 08:49:52 UTC (rev 14128)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/contexts/ServerConversationContext.java 2011-07-19 10:04:52 UTC (rev 14129)
@@ -291,18 +291,22 @@
}
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