[jboss-cvs] jboss-seam/src/main/org/jboss/seam/contexts ...
Gavin King
gavin.king at jboss.com
Sun Jun 17 21:21:06 EDT 2007
User: gavin
Date: 07/06/17 21:21:06
Modified: src/main/org/jboss/seam/contexts Lifecycle.java
Log:
JBSEAM-798
Revision Changes Path
1.97 +19 -0 jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Lifecycle.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -b -r1.96 -r1.97
--- Lifecycle.java 13 Jun 2007 21:07:33 -0000 1.96
+++ Lifecycle.java 18 Jun 2007 01:21:06 -0000 1.97
@@ -13,6 +13,7 @@
import javax.faces.event.PhaseId;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
+import javax.transaction.SystemException;
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
@@ -28,6 +29,7 @@
import org.jboss.seam.servlet.ServletApplicationMap;
import org.jboss.seam.servlet.ServletRequestMap;
import org.jboss.seam.servlet.ServletRequestSessionMap;
+import org.jboss.seam.transaction.Transaction;
/**
* @author Gavin King
@@ -431,6 +433,23 @@
if ( Contexts.isBusinessProcessContextActive() )
{
+ boolean transactionActive = false;
+ try
+ {
+ transactionActive = Transaction.instance().isActive();
+ }
+ catch (SystemException se)
+ {
+ log.error("could not discover transaction status", se);
+ }
+ if (transactionActive)
+ {
+ //in calls to MDBs and remote calls to SBs, the
+ //transaction doesn't commit until after contexts
+ //are destroyed, so pre-emptively flush here:
+ Contexts.getBusinessProcessContext().flush();
+ }
+
//TODO: it would be nice if BP context spanned redirects along with the conversation
// this would also require changes to BusinessProcessContext
boolean destroyBusinessProcessContext = !Init.instance().isJbpmInstalled() ||
More information about the jboss-cvs-commits
mailing list