river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1025757 - /incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java
Date Wed, 20 Oct 2010 21:16:59 GMT
Author: pats
Date: Wed Oct 20 21:16:59 2010
New Revision: 1025757

URL: http://svn.apache.org/viewvc?rev=1025757&view=rev
Log:
RIVER-361: Make TxnManagerImpl conform to TransactionManager interface by only throwing CannotAbortException
for an attempt to abort a COMMITTED transaction. The change lets retries of aborts work, so
GetStateTest passes.

Modified:
    incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java

Modified: incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java?rev=1025757&r1=1025756&r2=1025757&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java Wed Oct 20 21:16:59
2010
@@ -919,19 +919,14 @@ class TxnManagerImpl /*extends RemoteSer
             "Retrieved TxnManagerTransaction: {0}", txntr);
 	}
 	
-	if(txntr != null) {		
-		
-		switch(txntr.getState()) {
-			case TransactionConstants.COMMITTED:
-				if(doExpiryCheck && !ensureCurrent(txntr)) {
-					throw new TimeoutExpiredException("Cannot abort, transaction probably expired", true);
-				} else {
-					throw new CannotAbortException("Already committed");
-				}
-			case TransactionConstants.ABORTED :
-				throw new CannotAbortException("Transaction previously aborted");							
-		}	
-		
+	if(txntr != null) {
+		if(txntr.getState() == TransactionConstants.COMMITTED) {
+			if(doExpiryCheck && !ensureCurrent(txntr)) {
+				throw new TimeoutExpiredException("Cannot abort, transaction probably expired", true);
+			} else {
+				throw new CannotAbortException("Already committed");
+			}
+		}
 	} else {	
 	    throw new UnknownTransactionException("No such transaction ["+id+"]");
 	}



Mime
View raw message