Bug 851020 - No documentation on how transactions and retries work
No documentation on how transactions and retries work
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: doc-ESB_Programmers_Guide (Show other bugs)
5.3.0 GA
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 5.3.1
Assigned To: Suz
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-23 02:03 EDT by Johnathan Ingram
Modified: 2014-11-09 18:03 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-20 21:47:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Johnathan Ingram 2012-08-23 02:03:37 EDT
Description of problem:
The documentation does not cover how transactions work within a service pipeline

Version-Release number of selected component (if applicable):
5.3

Expected results:
The documentation needs to clearly define how transactions are catered for in a service pipeline.

The documentation should identify that a service pipeline can run either in a transaction or not and how these two life cycles differ, specifically when a transactional pipeline commits or rolls back.


Firstly, to be transactional, there needs to be a JCA listener on the service with the transact set to true. Even though a non JCA listener has the transact property, these never create a transaction, only if its a JCA listener.

Secondly there needs to be information on how to retrieve the TransactionManager object when running in an application server. I did this with a JNDI lookup, however there may be API in SOA-P that I am not aware of, if so this should be documented.

Thirdly, the life cycle of a service pipeline when using transactions needs to be documented.
What I noticed is that the normal lifecycle is followed, however, the transaction can still be rolled back during the commit phase which occurs after all the onSuccess methods of the actions are called.
So this would be critical to understand that even though an action has had its onSuccess invoked, the entire pipeline can still fail and rollback during commit phase which would cause the message to retry the pipe.

Fourthly when using JMS JCA listener, the retries will occur from the message queue. If max retries and interval between retries is not set on the queue, then this will be far too aggressive when retrying. This also needs to be documented.
For HornetQ, you can include a hornetq-configuration.xml covering the rety policy for the specific queue the service is running from.

<configuration xmlns="urn:hornetq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
   <address-settings>
     <address-setting match="jms.queue.MyServiceQueue">
        <max-delivery-attempts>5</max-delivery-attempts>
        <redelivery-delay>1000</redelivery-delay>
        <max-size-bytes>10240</max-size-bytes> 
     </address-setting>
   </address-settings>                
</configuration>

Lastly the documentation needs to clearly identify that in order for a service action to rollback, it needs to either setRollbackOnly on the current transaction or throw an unchecked / RunTime exception our of the process method.
Comment 1 David Le Sage 2012-08-23 17:59:52 EDT
Jonathan,

Thanks for your feedback. It is greatly appreciated.  We will review your suggestions and incorporate them into the docs.


David
Comment 2 Suz 2013-02-01 00:54:37 EST
Added topic called Transactions and the Service Pipeline which addresses several of the points raised above:
"The service pipeline is capable of running either in a transaction or by itself. To perform the former, a service must have a JCA listener attached to it with the <emphasis>transact</emphasis> property set to <emphasis>true</emphasis>. It must also be told how to retrieve the <property>TransactionManager</property> when running in an application server. This can be accomplished by running JNDI look-up.
When working in the service pipeline, transactions can be rolled back during the commit phase which occurs after all the <emphasis>onSuccess</emphasis> methods of the actions are called. The entire pipeline can still fail and rollback during commit phase which would cause the message to retry the pipe."

Looking into the other points.
Comment 3 Suz 2013-02-06 23:08:41 EST
The following topics have been added to the Advanced Topics chapter:

    Transactions and the Action Pipeline [13020]
    Rollbacks	[13356]
    Rollbacks and the JMS JCA Listener [13355]

Note You need to log in before you can comment on or make changes to this bug.