[jboss-svn-commits] JBL Code SVN: r32604 - labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/subordinate.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Apr 23 10:25:40 EDT 2010


Author: adinn
Date: 2010-04-23 10:25:39 -0400 (Fri, 23 Apr 2010)
New Revision: 32604

Modified:
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/subordinate/SubordinateATCoordinator.java
Log:
modified subordinate coordinator to call afterCommit and afterRollback synchronizations correctly when prepare is read only -- fixes for JBTM-737

Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/subordinate/SubordinateATCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/subordinate/SubordinateATCoordinator.java	2010-04-23 14:25:26 UTC (rev 32603)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/subordinate/SubordinateATCoordinator.java	2010-04-23 14:25:39 UTC (rev 32604)
@@ -71,6 +71,7 @@
 	{
 		super();
         activated = true;
+        isReadonly = false;
 	}
 
     /**
@@ -80,6 +81,7 @@
 	{
 		super();
         activated = true;
+        isReadonly = false;
         this.subordinateType = subordinateType;
 	}
 
@@ -91,6 +93,7 @@
 	{
 		super(recovery);
         activated = false;
+        isReadonly = false;
         subordinateType = null;
 	}
 
@@ -152,7 +155,9 @@
 
 	public int prepare ()
 	{
-        return super.prepare(true);
+        int status = super.prepare(true);
+        isReadonly = (status == TwoPhaseOutcome.PREPARE_READONLY);
+        return status;
 	}
 
     /**
@@ -160,7 +165,11 @@
      */
     public void commitVolatile()
     {
-        super.afterCompletion(finalStatus);
+        if (isReadonly) {
+            super.afterCompletion(ActionStatus.COMMITTED);
+        } else {
+            super.afterCompletion(finalStatus);
+        }
     }
 
     /**
@@ -214,7 +223,11 @@
      */
     public void rollbackVolatile()
     {
-        super.afterCompletion(finalStatus);
+        if (isReadonly) {
+            super.afterCompletion(ActionStatus.ABORTED);
+        } else {
+            super.afterCompletion(finalStatus);
+        }
     }
 
     /**
@@ -428,6 +441,12 @@
     private boolean activated;
 
     /**
+     * flag identifying whether prepare returned READ_ONLY and hence whether special case handling of
+     * commitVolatile and rollbackVolatile calls is required
+     */
+    private boolean isReadonly;
+
+    /**
      * string identifying which type of subordinate transaction this is. the standard subordinate type is
      * XTSATRecoveryManager.SUBORDINATE_TX_TYPE_AT_AT which identifies a subordinate of another AT transaction.
      * Alternative types can occur as a result of transaction bridging e.g. the AT transaction may be a



More information about the jboss-svn-commits mailing list