tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r643545 - in /openejb/branches/openejb-3.0: container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TransactionPolicy.java server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java
Date Tue, 01 Apr 2008 20:00:32 GMT
Author: dblevins
Date: Tue Apr  1 13:00:29 2008
New Revision: 643545

URL: http://svn.apache.org/viewvc?rev=643545&view=rev
Log:
Merging r643179 - http://svn.apache.org/viewvc?rev=643179&view=rev

svn merge -r 643178:643179 https://svn.apache.org/repos/asf/openejb/trunk/openejb3 .

------------------------------------------------------------------------
r643179 | djencks | 2008-03-31 15:12:57 -0700 (Mon, 31 Mar 2008) | 1 line

OPENEJB-782 Further refinements on delivering the apropriate exception to the client on unexpected
rollback
------------------------------------------------------------------------

Modified:
    openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TransactionPolicy.java
    openejb/branches/openejb-3.0/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java

Modified: openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TransactionPolicy.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TransactionPolicy.java?rev=643545&r1=643544&r2=643545&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TransactionPolicy.java
(original)
+++ openejb/branches/openejb-3.0/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TransactionPolicy.java
Tue Apr  1 13:00:29 2008
@@ -32,6 +32,7 @@
 import javax.transaction.RollbackException;
 import javax.transaction.NotSupportedException;
 import javax.ejb.EJBException;
+import javax.ejb.EJBTransactionRolledbackException;
 
 import java.rmi.RemoteException;
 
@@ -133,7 +134,7 @@
         }
     }
 
-    protected void commitTransaction(TransactionContext context, Transaction tx) throws SystemException
{
+    protected void commitTransaction(TransactionContext context, Transaction tx) throws SystemException,
ApplicationException {
         try {
             if (txLogger.isInfoEnabled()) {
                 txLogger.info("TX " + policyToString() + ": Committing transaction " + tx);
@@ -147,7 +148,8 @@
         } catch (RollbackException e) {
 
             txLogger.info("The transaction has been rolled back rather than commited: " +
e.getMessage());
-            throw new EJBException(e);
+            Exception txe = new EJBTransactionRolledbackException("Transaction was rolled
back, presumably because setRollbackOnly was called during a synchronization", e);
+            throw new ApplicationException(txe);
 
         } catch (HeuristicMixedException e) {
 

Modified: openejb/branches/openejb-3.0/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.0/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java?rev=643545&r1=643544&r2=643545&view=diff
==============================================================================
--- openejb/branches/openejb-3.0/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java
(original)
+++ openejb/branches/openejb-3.0/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java
Tue Apr  1 13:00:29 2008
@@ -39,6 +39,7 @@
 import javax.ejb.EJBObject;
 import javax.ejb.EJBHome;
 import javax.ejb.NoSuchEJBException;
+import javax.ejb.EJBTransactionRolledbackException;
 
 public abstract class EJBInvocationHandler implements InvocationHandler, Serializable {
 
@@ -224,6 +225,9 @@
             } else {
                 return new AccessException(e.getMessage());
             }
+        }
+        if (!remote && e instanceof EJBTransactionRolledbackException) {
+            return new TransactionRolledbackLocalException(e.getMessage()).initCause(getCause(e));
         }
         return e;
     }



Mime
View raw message