[jboss-svn-commits] JBL Code SVN: r20141 - labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri May 23 12:28:48 EDT 2008


Author: kevin.conner at jboss.com
Date: 2008-05-23 12:28:47 -0400 (Fri, 23 May 2008)
New Revision: 20141

Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt
Log:
Document the output from the console: JBESB-1664

Modified: labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt	2008-05-23 16:26:58 UTC (rev 20140)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/readme.txt	2008-05-23 16:28:47 UTC (rev 20141)
@@ -32,33 +32,55 @@
 	* The first time we enter the action pipleline, we insert a row into the database: (server console output below)
 	    [DBInsertAction] Successfully inserted [Hello Transacted JMS World] counter[1]] into jms_transacted_table	
 
-	* Next, the RollbackTransationAction is called. 
-	  This action can be configured with the number of times the action should rollback the transaction (jboss-esb.xml):
-	    <property name="nr-of-rollbacks" value="5"/>
+	* Next, the ThrowExceptionAction is called. 
+	  This action can be configured with the number of times the action
+          should throw an exception to rollback the transaction (jboss-esb.xml):
+	    <property name="rollbacks" value="5"/>
 
-	  The default configuration will cause the transaction to be rolled back 5 times: (server console ouput below)
-	    [RollbackTransactionAction] Setting transaction to rollback only
+	  In the cases where the exception is thrown, this will result in the
+          JCA adapter rolling back the transaction.  As a consequence the
+          database insert in the preceding action will also be rolled back.
 
-	  In the cases where the transaction is rolled back, the database insert in the preceeding action is also rolled back.
-	  After 'nr-of-rollbacks' has been reached the action pipeline will complete normally: (server console ouput below)
-	    [DBInsertAction] Successfully inserted [Hello Transacted JMS World] counter[5]] into jms_transacted_table
-	    [STDOUT] JMS Transacted Quickstart processed sucessfully: 
+          The console output will display an error message from the
+          ActionProcessingPipeline followed by a stacktrace of the
+          generated exception.  This exception is then propagated to the
+          JCA/JMS adapter which will also document the issue.
 
+          Part of the console output follows:
+           [ActionProcessingPipeline] Unexpected exception caught while
+           processing the action pipeline:
+           java.lang.IllegalStateException: [Throwing Exception to trigger a
+           transaction rollback]
+           [JmsServerSession] Unexpected error delivering message
+           delegator->JBossMessage[512]:PERSISTENT, deliveryId=1
+           java.lang.IllegalStateException: [Throwing Exception to trigger a
+           transaction rollback]
+
+	  After the configured number of rollbacks has been reached, the action
+          will complete normally allowing the transaction to commit.
+
+          [STDOUT] JMS Transacted Quickstart entered. Message body: 
+          [STDOUT] [Hello Transacted JMS World]].
+          [DBInsertAction] Successfully inserted [Hello Transacted JMS World]
+          counter[6]] into jms_transacted_table
+          [STDOUT] JMS Transacted Quickstart processed successfully. Message body: 
+
 	* Only the last insert will be committed to the database when the action pipeline successfully completes.
 	  In the console output window where 'ant runtest' was run from, the output of the database table is displayed:
 	    [echo] Select * from jms_transacted_table
 	    [sql] Executing commands
 	    [sql] DATA_COLUMN
 	    [sql] Hello Transacted JMS World] counter[5]
+            [sql] Hello Transacted JMS World] counter[6]
 	    [sql] 
 	    [sql] 0 rows affected
 	    [sql] 1 of 1 SQL statements executed successfully
 	  This shows that only the last insert was committed. The others were never written to the database since they were
 	  rolled back.
 
-	  The value of counter in 'Hello Transacted JMS World] counter[5]' should always match the value in the servers console for 
+	  The value of counter in 'Hello Transacted JMS World] counter[6]' should always match the value in the servers console for 
 	  the last successfully completed execution of the action pipeline:
-	    [DBInsertAction] Successfully inserted [Hello Transacted JMS World] counter[5]] into jms_transacted_table
+	    [DBInsertAction] Successfully inserted [Hello Transacted JMS World] counter[6]] into jms_transacted_table
 	    [STDOUT] JMS Transacted Quickstart processed successfully: 
 	    [STDOUT] [Hello Transacted JMS World]].
 
@@ -69,11 +91,14 @@
      The string looks like this: [Hello Transacted JMS World] counter[1]] 
      This is done to seperate the inserts and visually verify that the correct data is committed to the database. 
 	  
-  3. org.jboss.soa.esb.samples.quickstart.jmstransacted.test.RollbackTransactionAction
-     The current transaction is rolled back by the folling code in the process method:
-       TransactionStrategy strategy = TransactionStrategy.getTransactionStrategy(true);
-       log.info( "Setting transaction to rollback only" );
-       strategy.rollbackOnly();
+  3. org.jboss.soa.esb.samples.quickstart.jmstransacted.test.ThrowExceptionAction
+     The current transaction is rolled back as a result of the action
+     handler throwing a RuntimeException (or a subclass of such) during
+     the processing method.  The exception is caught by the
+     ActionProcessingPipeline but, as it is not identified as an application
+     exception, it will be propagated to the caller (in this case the
+     JMS/JCA adapter).  The JMS/JCA adapter will then force the enclosing
+     transaction to rollback, resulting in the redelivery of the message.
 
   4. jboss-esb.xml
      The message-filter for the jms-bus-filter now specifies 'transacted' attribute.




More information about the jboss-svn-commits mailing list