[jboss-svn-commits] JBL Code SVN: r35014 - labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/coordinator.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Sep 6 06:35:19 EDT 2010


Author: mmusgrov
Date: 2010-09-06 06:35:18 -0400 (Mon, 06 Sep 2010)
New Revision: 35014

Modified:
   labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/coordinator/ArjunaTransactionImple.java
Log:
[JBTM-774] Backport fix from trunk revision 35004

Modified: labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/coordinator/ArjunaTransactionImple.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/coordinator/ArjunaTransactionImple.java	2010-09-06 09:35:49 UTC (rev 35013)
+++ labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/coordinator/ArjunaTransactionImple.java	2010-09-06 10:35:18 UTC (rev 35014)
@@ -1317,19 +1317,24 @@
 		if ((currentStatus != Status.StatusActive)
 				&& (currentStatus != Status.StatusMarkedRollback))
 		{
-			throw new Unavailable();
+			/*
+			 * If XA compliant then return context even if we're inactive. Otherwise
+			 * throw Unavailable for consistency with other OTS implementations.
+			 */
+
+			if (!XA_COMPLIANT)
+				throw new Unavailable();
 		}
-		else
+
+		try
 		{
-			try
-			{
-				return propagationContext();
-			}
-			catch (Exception e)
-			{
-				throw new Unavailable();
-			}
+			return propagationContext();
 		}
+		catch (Exception e)
+		{
+			throw new UNKNOWN(e.toString(), ExceptionCodes.UNKNOWN_EXCEPTION,
+				CompletionStatus.COMPLETED_NO);
+		}
 	}
 
 	/*
@@ -2357,6 +2362,8 @@
 
 	static boolean _propagateRemainingTimeout = true;  // OTS 1.2 onwards supported this.
 
+	private static final boolean XA_COMPLIANT = true; // if we ever want to disable this then add an mbean option.
+
 	/**
 	 * @message com.arjuna.ats.internal.jts.orbspecific.coordinator.ipunknown
 	 *          {0} - unknown interposition type: {1}



More information about the jboss-svn-commits mailing list