[jboss-svn-commits] JBL Code SVN: r20515 - labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jun 16 06:16:01 EDT 2008


Author: adinn
Date: 2008-06-16 06:16:01 -0400 (Mon, 16 Jun 2008)
New Revision: 20515

Modified:
   labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java
Log:
modified status return to note cancellation and/or compensation for BA case

Modified: labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java	2008-06-16 10:14:37 UTC (rev 20514)
+++ labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java	2008-06-16 10:16:01 UTC (rev 20515)
@@ -409,7 +409,10 @@
             }
             else if ("BusinessActivity".equals(txType))
             {
-                testBusinessActivity(restaurantSeats, theatreSeats, theatreArea, bookTaxi);
+                if (!testBusinessActivity(restaurantSeats, theatreSeats, theatreArea, bookTaxi))
+                {
+                    result = "Transaction cancelled/compensated.";
+                }
             }
             else
             {
@@ -418,7 +421,7 @@
         }
         catch (final TransactionRolledBackException tre)
         {
-            result = "Transaction rolled back" ;
+            result = "Transaction rolled back." ;
             System.out.println("Transaction rolled back") ;
         }
         catch (Exception e)
@@ -481,7 +484,7 @@
      *
      * @throws Exception for any unexpected errors, such as a failure to commit.
      */
-    private void testBusinessActivity(int restaurantSeats, int theatreSeats, int theatreArea, boolean bookTaxi) throws Exception
+    private boolean testBusinessActivity(int restaurantSeats, int theatreSeats, int theatreArea, boolean bookTaxi) throws Exception
     {
         System.out.println("CLIENT: obtaining userBusinessActivity...");
 
@@ -522,6 +525,8 @@
 
         System.out.println("CLIENT: done.");
         System.out.flush();
+
+        return isOK;
     }
 
     /**




More information about the jboss-svn-commits mailing list