[jboss-svn-commits] JBL Code SVN: r37649 - in labs/jbosstm/branches/JBOSSTS_4_15_0_Final/atsintegration/examples/classes/com/arjuna/jta/distributed/example/server: impl and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Oct 21 07:58:38 EDT 2011


Author: tomjenkinson
Date: 2011-10-21 07:58:37 -0400 (Fri, 21 Oct 2011)
New Revision: 37649

Modified:
   labs/jbosstm/branches/JBOSSTS_4_15_0_Final/atsintegration/examples/classes/com/arjuna/jta/distributed/example/server/LocalServer.java
   labs/jbosstm/branches/JBOSSTS_4_15_0_Final/atsintegration/examples/classes/com/arjuna/jta/distributed/example/server/impl/ServerImpl.java
Log:
JBTM-895 added more documentation

Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/atsintegration/examples/classes/com/arjuna/jta/distributed/example/server/LocalServer.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/atsintegration/examples/classes/com/arjuna/jta/distributed/example/server/LocalServer.java	2011-10-21 09:51:53 UTC (rev 37648)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/atsintegration/examples/classes/com/arjuna/jta/distributed/example/server/LocalServer.java	2011-10-21 11:58:37 UTC (rev 37649)
@@ -77,6 +77,9 @@
 	 * Store the current transaction, this is so if a subordinate comes back
 	 * here we have a hashmap to locate the transaction in.
 	 * 
+	 * Clearly servers where the transaction has been inflowed back to *must
+	 * not* commit the transaction.
+	 * 
 	 * @throws SystemException
 	 */
 	public void storeRootTransaction(Transaction transaction) throws SystemException;
@@ -92,6 +95,11 @@
 	 * Either create or locate a subordinate (or root) transaction for a given
 	 * Xid.
 	 * 
+	 * If it is the root transaction, it must not be committed!
+	 * 
+	 * e.g. A transaction flowed 1,2,1 **must not** be committed at the third
+	 * stage of the flow even though we are back at the originating server!!!
+	 * 
 	 * @param remainingTimeout
 	 * @param toImport
 	 * @return

Modified: labs/jbosstm/branches/JBOSSTS_4_15_0_Final/atsintegration/examples/classes/com/arjuna/jta/distributed/example/server/impl/ServerImpl.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_15_0_Final/atsintegration/examples/classes/com/arjuna/jta/distributed/example/server/impl/ServerImpl.java	2011-10-21 09:51:53 UTC (rev 37648)
+++ labs/jbosstm/branches/JBOSSTS_4_15_0_Final/atsintegration/examples/classes/com/arjuna/jta/distributed/example/server/impl/ServerImpl.java	2011-10-21 11:58:37 UTC (rev 37649)
@@ -160,6 +160,12 @@
 		return transactionManagerService.getTransactionManager();
 	}
 
+	/**
+	 * If this returns the root transaction, it must not be committed!
+	 * 
+	 * e.g. A transaction flowed 1,2,1 **must not** be committed at the third
+	 * stage of the flow!!!
+	 */
 	@Override
 	public boolean getAndResumeTransaction(int remainingTimeout, Xid toResume) throws XAException, InvalidTransactionException, IllegalStateException,
 			SystemException {
@@ -181,6 +187,13 @@
 		return nodeName;
 	}
 
+	/**
+	 * If a subordinate returns the root transaction in a call to
+	 * getAndResumeTransaction, it must not be committed
+	 * 
+	 * e.g. A transaction flowed 1,2,1 **must not** be committed at the third
+	 * stage of the flow!!!
+	 */
 	@Override
 	public void storeRootTransaction(Transaction transaction) throws SystemException {
 		TransactionImple transactionI = ((TransactionImple) transaction);
@@ -276,7 +289,8 @@
 		ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
 		try {
 			Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
-			// Pass in true so we can recover the inflight transactions for this node
+			// Pass in true so we can recover the inflight transactions for this
+			// node
 			Xid[] recovered = ((XATerminatorImple) SubordinationManager.getXATerminator()).doRecover(parentNodeName, true);
 			return recovered;
 		} finally {



More information about the jboss-svn-commits mailing list