geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1029727 - in /geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2: ./ geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/
Date Mon, 01 Nov 2010 16:08:41 GMT
Author: djencks
Date: Mon Nov  1 16:08:41 2010
New Revision: 1029727

URL: http://svn.apache.org/viewvc?rev=1029727&view=rev
Log:
GERONIMO-5648 fix some errors in RollbackTask shown by osgi tx tests. Merge from trunk

Modified:
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/   (props changed)
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/CommitTask.java
    geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RollbackTask.java

Propchange: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov  1 16:08:41 2010
@@ -1,2 +1,2 @@
 /geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.1.1:981270
-/geronimo/components/txmanager/trunk:900557,911974,912058,912297,912468,939929
+/geronimo/components/txmanager/trunk:900557,911974,912058,912297,912468,939929,1028958

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/CommitTask.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/CommitTask.java?rev=1029727&r1=1029726&r2=1029727&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/CommitTask.java
(original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/CommitTask.java
Mon Nov  1 16:08:41 2010
@@ -89,7 +89,7 @@ public class CommitTask implements Runna
                     } else if (e.errorCode == XAException.XAER_RMFAIL) {
                         //refresh the xa resource from the NamedXAResourceFactory
                         if (manager.getCommitter() instanceof NamedXAResource) {
-                            String xaResourceName = ((NamedXAResource)manager.getCommitter()).getName();
+                            String xaResourceName = manager.getResourceName();
                             NamedXAResourceFactory namedXAResourceFactory = txManager.getNamedXAResourceFactory(xaResourceName);
                             if (namedXAResourceFactory != null) {
                                 try {

Modified: geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RollbackTask.java
URL: http://svn.apache.org/viewvc/geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RollbackTask.java?rev=1029727&r1=1029726&r2=1029727&view=diff
==============================================================================
--- geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RollbackTask.java
(original)
+++ geronimo/components/txmanager/branches/geronimo-txmanager-parent-2.2/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RollbackTask.java
Mon Nov  1 16:08:41 2010
@@ -52,6 +52,7 @@ public class RollbackTask implements Run
         this.txManager = txManager;
     }
 
+    @Override
     public void run() {
         synchronized (this) {
             status = Status.STATUS_ROLLING_BACK;
@@ -66,7 +67,10 @@ public class RollbackTask implements Run
                 } catch (XAException e) {
                     log.error("Unexpected exception committing " + manager.getCommitter()
+ "; continuing to commit other RMs", e);
 
-                    if (e.errorCode == XAException.XA_HEURRB) {
+                    if (e.errorCode >= XAException.XA_RBBASE && e.errorCode <=
XAException.XA_RBEND || e.errorCode == XAException.XAER_NOTA) {
+                        remove(index);
+                        everRolledBack = true;
+                    } else if (e.errorCode == XAException.XA_HEURRB) {
                         remove(index);
                         // let's not throw an exception as the transaction has been rolled
back
                         log.info("Transaction has been heuristically rolled back");
@@ -86,10 +90,10 @@ public class RollbackTask implements Run
                     } else if (e.errorCode == XAException.XA_RETRY) {
                         // do nothing, retry later
                         index++;
-                    } else if (e.errorCode == XAException.XAER_RMFAIL) {
+                    } else if (e.errorCode == XAException.XAER_RMFAIL || e.errorCode == XAException.XAER_RMERR)
{
                         //refresh the xa resource from the NamedXAResourceFactory
                         if (manager.getCommitter() instanceof NamedXAResource) {
-                            String xaResourceName = ((NamedXAResource)manager.getCommitter()).getName();
+                            String xaResourceName = manager.getResourceName();
                             NamedXAResourceFactory namedXAResourceFactory = txManager.getNamedXAResourceFactory(xaResourceName);
                             if (namedXAResourceFactory != null) {
                                 try {
@@ -106,15 +110,10 @@ public class RollbackTask implements Run
                                 index++;
                             }
                         } else {
-                            //no hope
+                            //no hope.  Since we don't record the exception if we do manage
to retry stuff later, presumably we shouldn't now, either.
                             remove(index);
-                            cause = e;
                         }
                     } else {
-                        //at least these error codes:
-                        // XAException.XA_RMERR
-                        // XAException.XA_RBROLLBACK
-                        // XAException.XAER_NOTA
                         //nothing we can do about it
                         remove(index);
                         cause = e;



Mime
View raw message