[jboss-svn-commits] JBL Code SVN: r18819 - labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Mar 11 07:35:51 EDT 2008


Author: mark.little at jboss.com
Date: 2008-03-11 07:35:51 -0400 (Tue, 11 Mar 2008)
New Revision: 18819

Modified:
   labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java
Log:
http://jira.jboss.com/jira/browse/JBTM-343

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	2008-03-11 11:07:08 UTC (rev 18818)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java	2008-03-11 11:35:51 UTC (rev 18819)
@@ -727,6 +727,7 @@
 					return _heuristic;
 
 				boolean commit = true;
+				XAException endHeuristic = null;
 				
 				try
 				{
@@ -741,23 +742,48 @@
 					}
 				}
 				catch (XAException e1)
-				{
-				    if ((e1.errorCode >= XAException.XA_RBBASE)
-						&& (e1.errorCode < XAException.XA_RBEND))
+				{    
+				    /*
+				     * Now it's not legal to return a heuristic from end, but
+				     * apparently Oracle does (http://jira.jboss.com/jira/browse/JBTM-343)
+				     * Since this is 1PC we can call forget: the outcome of the
+				     * transaction is the outcome of the participant.
+				     */
+
+				    switch (e1.errorCode)
 				    {
+				    case XAException.XA_HEURHAZ:
+				    case XAException.XA_HEURMIX:
+				    case XAException.XA_HEURCOM:
+				    case XAException.XA_HEURRB:
+					endHeuristic = e1;
+					break;
+				    case XAException.XA_RBROLLBACK:
+				    case XAException.XA_RBCOMMFAIL:
+				    case XAException.XA_RBDEADLOCK:
+				    case XAException.XA_RBINTEGRITY:
+				    case XAException.XA_RBOTHER:
+				    case XAException.XA_RBPROTO:
+				    case XAException.XA_RBTIMEOUT:
+				    case XAException.XA_RBTRANSIENT:
 					/*
 					 * Has been marked as rollback-only. We still
 					 * need to call rollback.
 					 */
 					
 					commit = false;
-				    }
-				    else
+					break;
+				    case XAException.XAER_RMERR:
+				    case XAException.XAER_NOTA:
+				    case XAException.XAER_PROTO:
+				    case XAException.XAER_INVAL:
+				    case XAException.XAER_RMFAIL:
+				    default:
 				    {
 					removeConnection();
-					
 					return TwoPhaseOutcome.FINISH_ERROR;
 				    }
+				    }
 				}
 				
 				try
@@ -767,6 +793,9 @@
 				     * do the rollback if end failed as above.
 				     */
 				    
+				    if (endHeuristic != null) // catch those RMs that terminate in end rather than follow the spec
+					throw endHeuristic;
+				    
 				    if (commit)
 					_theXAResource.commit(_tranID, true);
 				    else




More information about the jboss-svn-commits mailing list