[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Thu Mar 8 17:47:35 EST 2007
User: gavin
Date: 07/03/08 17:47:35
Modified: src/main/org/jboss/seam/core PersistenceContexts.java
Log:
more robust
Revision Changes Path
1.7 +12 -5 jboss-seam/src/main/org/jboss/seam/core/PersistenceContexts.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PersistenceContexts.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/PersistenceContexts.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- PersistenceContexts.java 8 Mar 2007 08:24:36 -0000 1.6
+++ PersistenceContexts.java 8 Mar 2007 22:47:35 -0000 1.7
@@ -27,7 +27,7 @@
private static final long serialVersionUID = -4897350516435283182L;
private Set<String> set = new HashSet<String>();
private FlushModeType flushMode = FlushModeType.AUTO;
- private FlushModeType actualFlushMode;
+ private FlushModeType actualFlushMode = FlushModeType.AUTO;
public FlushModeType getFlushMode()
{
@@ -59,6 +59,12 @@
public void changeFlushMode(FlushModeType flushMode)
{
this.flushMode = flushMode;
+ this.actualFlushMode = flushMode;
+ changeFlushModes();
+ }
+
+ private void changeFlushModes()
+ {
for (String name: set)
{
PersistenceContextManager pcm = (PersistenceContextManager) Contexts.getConversationContext().get(name);
@@ -71,14 +77,15 @@
public void beforeRender()
{
- actualFlushMode = flushMode;
PersistenceProvider pp = PersistenceProvider.instance();
- changeFlushMode( pp==null ? FlushModeType.MANUAL : pp.getRenderFlushMode() );
+ flushMode = pp==null ? FlushModeType.MANUAL : pp.getRenderFlushMode();
+ changeFlushModes();
}
public void afterRender()
{
- changeFlushMode(actualFlushMode);
+ flushMode = actualFlushMode;
+ changeFlushModes();
}
}
More information about the jboss-cvs-commits
mailing list