[jboss-svn-commits] JBL Code SVN: r31334 - in labs/jbosstm/trunk: ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Jan 30 05:46:39 EST 2010


Author: mark.little at jboss.com
Date: 2010-01-30 05:46:39 -0500 (Sat, 30 Jan 2010)
New Revision: 31334

Modified:
   labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/AbstractRecord.java
   labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/BasicAction.java
   labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAOnePhaseResource.java
   labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java
   labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/orbspecific/XAResourceRecord.java
Log:
https://jira.jboss.org/jira/browse/JBTM-692

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/AbstractRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/AbstractRecord.java	2010-01-30 00:48:40 UTC (rev 31333)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/AbstractRecord.java	2010-01-30 10:46:39 UTC (rev 31334)
@@ -581,7 +581,7 @@
 	}
 
 	/**
-	 * Create a new instance with the specified paramaters.
+	 * Create a new instance with the specified parameters.
 	 *
 	 * @param storeUid the unique id for this instance.
 	 * @param objType the type of the instance.

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/BasicAction.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/BasicAction.java	2010-01-30 00:48:40 UTC (rev 31333)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/BasicAction.java	2010-01-30 10:46:39 UTC (rev 31334)
@@ -288,6 +288,8 @@
  *          CheckedActionFactory resolution problem with
  * @message com.arjuna.ats.arjuna.coordinator.notrunning
  *          [com.arjuna.ats.arjuna.coordinator.notrunning] - Cannot begin new transaction as TM is disabled. Marking as rollback-only.
+ * @message com.arjuna.ats.arjuna.coordinator.norecordfound
+ *          [com.arjuna.ats.arjuna.coordinator.norecordfound] - Could not recreate abstract record {0}
  */
 
 public class BasicAction extends StateManager
@@ -1314,7 +1316,7 @@
 
 					if (temp == first)
 					{
-						heuristicList.putFront(temp);
+						heuristicList.putFront(temp);   
 						temp = null;
 					}
 				}
@@ -1494,10 +1496,10 @@
 			{
 			    AbstractRecord record = AbstractRecord.create(record_type);
 
-				res = (record.restore_state(os, ot) && heuristicList.insert(record));
-
 				try
 				{
+	                                res = (record.restore_state(os, ot) && heuristicList.insert(record));
+
 					record_type = os.unpackInt();
 
 					if (tsLogger.arjLoggerI18N.isDebugEnabled())
@@ -1510,6 +1512,13 @@
 				{
 					res = false;
 				}
+				catch (final NullPointerException ex)
+				{
+				    if (tsLogger.arjLoggerI18N.isWarnEnabled())
+                                        tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.coordinator.norecordfound", new Object[] { record_type});
+				    
+				    res = false;
+				}
 			}
 		}
 

Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAOnePhaseResource.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAOnePhaseResource.java	2010-01-30 00:48:40 UTC (rev 31333)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAOnePhaseResource.java	2010-01-30 10:46:39 UTC (rev 31334)
@@ -146,14 +146,12 @@
                 return TwoPhaseOutcome.ONE_PHASE_ERROR;
             case XAException.XAER_NOTA:
                 return TwoPhaseOutcome.HEURISTIC_HAZARD; // something committed or rolled back without asking us!
-            case XAException.XAER_INVAL:
-            case XAException.XAER_RMFAIL: // resource manager
-                // failed, did it
-                // rollback?
+            case XAException.XAER_INVAL: // resource manager failed, did it rollback?
                 return TwoPhaseOutcome.HEURISTIC_HAZARD;
             case XAException.XA_RETRY:  // XA does not allow this to be thrown for 1PC!
             case XAException.XAER_PROTO:
                 return TwoPhaseOutcome.ONE_PHASE_ERROR; // assume rollback
+            case XAException.XAER_RMFAIL:
             default:
                 return TwoPhaseOutcome.FINISH_ERROR;  // recovery should retry
             }

Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java	2010-01-30 00:48:40 UTC (rev 31333)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java	2010-01-30 10:46:39 UTC (rev 31334)
@@ -624,6 +624,7 @@
 						    else
 						        return TwoPhaseOutcome.HEURISTIC_HAZARD;  // something terminated the transaction!
 						case XAException.XA_RETRY:
+						case XAException.XAER_RMFAIL:
 						    _committed = true;  // will cause log to be rewritten
 						    
 	                                            /*
@@ -632,11 +633,7 @@
                                                      * the coordinator will continue to commit the other resources immediately.
                                                      */
 							return TwoPhaseOutcome.FINISH_ERROR;
-						case XAException.XAER_INVAL:
-						case XAException.XAER_RMFAIL: // resource manager
-							// failed, did it
-							// rollback?
-							return TwoPhaseOutcome.HEURISTIC_HAZARD;
+						case XAException.XAER_INVAL: // resource manager failed, did it rollback?
 						default:
 							return TwoPhaseOutcome.HEURISTIC_HAZARD;
 						}
@@ -880,14 +877,12 @@
 	                    return TwoPhaseOutcome.ONE_PHASE_ERROR;
 	                case XAException.XAER_NOTA:
 	                    return TwoPhaseOutcome.HEURISTIC_HAZARD; // something committed or rolled back without asking us!
-	                case XAException.XAER_INVAL:
-	                case XAException.XAER_RMFAIL: // resource manager
-	                    // failed, did it
-	                    // rollback?
+	                case XAException.XAER_INVAL: // resource manager failed, did it rollback?
 	                    return TwoPhaseOutcome.HEURISTIC_HAZARD;
 	                case XAException.XA_RETRY:  // XA does not allow this to be thrown for 1PC!
 	                case XAException.XAER_PROTO:
 	                    return TwoPhaseOutcome.ONE_PHASE_ERROR; // assume rollback
+	                case XAException.XAER_RMFAIL:
 	                default:
 	                    _committed = true;  // will cause log to be rewritten
 	                    return TwoPhaseOutcome.FINISH_ERROR;  // recovery should retry
@@ -937,6 +932,8 @@
 	{
 		if ((_theXAResource != null) && (_tranID != null))
 		{
+		    _heuristic = TwoPhaseOutcome.FINISH_OK;
+		    
 			try
 			{
 				_theXAResource.forget(_tranID);
@@ -1283,7 +1280,12 @@
 		_valid = true;
 		_theTransaction = null;
 		_recovered = true;
-	}
+	}	
+	       
+        public String toString ()
+        {
+            return "XAResourceRecord < resource:"+_theXAResource+", txid:"+_tranID+", heuristic"+TwoPhaseOutcome.stringForm(_heuristic)+" "+super.toString()+" >";
+        }
 
 	/**
 	 * For those objects where the original XAResource could not be saved.

Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/orbspecific/XAResourceRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/orbspecific/XAResourceRecord.java	2010-01-30 00:48:40 UTC (rev 31333)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/orbspecific/XAResourceRecord.java	2010-01-30 10:46:39 UTC (rev 31334)
@@ -624,13 +624,10 @@
                             throw new TRANSACTION_ROLLEDBACK();
 
 						case XAException.XA_RETRY:
+						case XAException.XAER_RMFAIL:
 						    _committed = true;  // remember for recovery later.
 							throw new UNKNOWN();  // will cause log to be rewritten.
-						case XAException.XAER_INVAL:
-						case XAException.XAER_RMFAIL: // resource manager
-													  // failed, did it
-													  // rollback?
-							throw new org.omg.CosTransactions.HeuristicHazard();
+						case XAException.XAER_INVAL: // resource manager failed, did it rollback?
 						default:
 							throw new org.omg.CosTransactions.HeuristicHazard();
 						}
@@ -900,10 +897,9 @@
 	                    // presumed abort (or we could be really paranoid and throw a heuristic)
 	                    throw new TRANSACTION_ROLLEDBACK();
 
-	                case XAException.XAER_INVAL:
-	                case XAException.XAER_RMFAIL: // resource manager failed,
-	                    // did it rollback?
+	                case XAException.XAER_INVAL: // resource manager failed, did it rollback?
 	                    throw new org.omg.CosTransactions.HeuristicHazard();
+	                case XAException.XAER_RMFAIL:
 	                default:
 	                    _committed = true;  // will cause log to be rewritten
 
@@ -963,6 +959,8 @@
 	{
 		if ((_theXAResource != null) && (_tranID != null))
 		{
+		    _heuristic = TwoPhaseOutcome.FINISH_OK;
+		    
 			try
 			{
 				_theXAResource.forget(_tranID);
@@ -1226,6 +1224,11 @@
 	{
 		return _recoveryCoordinator;
 	}
+	
+	public String toString ()
+	{
+	    return "XAResourceRecord < resource:"+_theXAResource+", txid:"+_tranID+", heuristic"+TwoPhaseOutcome.stringForm(_heuristic)+" "+super.toString()+" >";
+	}
 
 	protected XAResourceRecord(Uid u)
 	{



More information about the jboss-svn-commits mailing list