[ 
https://issues.apache.org/jira/browse/SYNAPSE-480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650144#action_12650144
 ] 

irantha edited comment on SYNAPSE-480 at 11/24/08 11:42 PM:
--------------------------------------------------------------------------

Tested with Jboss.
Scenario : Update two databases within a jta transaction.

<!-- Synapse configuration used for testing this scenario -->
<definitions xmlns="http://ws.apache.org/ns/synapse";>

    <sequence name="myFaultHandler">
        <log level="custom">
            <property name="text"  value="** Rollback Transaction**"/>
        </log>
        <transaction action="rollback"/>
        <send/>
    </sequence>

    <sequence name="main" onError="myFaultHandler">
           <in>
               <send>
                   <endpoint>
                       <address 
uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
                   </endpoint>
               </send>
           </in>

           <out>
               <transaction action="new" />

               <log level="custom">
                   <property name="text"  value="** Reporting to the Database 
synapse**"/>
               </log>
               <dbreport xmlns="http://ws.apache.org/ns/synapse";>
                   <connection>
                       <pool>
                           <dsName>java:XADerbyDS</dsName>
                           
<icClass>org.jnp.interfaces.NamingContextFactory</icClass>
                           <url>localhost:1099</url>
                           <user>synapse</user>
                           <password>synapse</password>
                       </pool>
                   </connection>
                   <statement>
                       <sql>update company set price=? where name =?</sql>
                       <parameter expression="//m0:return/m0:last/child::text()"
                                  xmlns:m0="http://services.samples/xsd"; 
type="DOUBLE"/>
                       <parameter 
expression="//m0:return/m0:symbol/child::text()"
                                  xmlns:m0="http://services.samples/xsd"; 
type="VARCHAR"/>
                   </statement>
               </dbreport>

               <log level="custom">
                   <property name="text"  value="** Reporting to the Database 
synapse2**"/>
               </log>
               <dbreport xmlns="http://ws.apache.org/ns/synapse";>
                   <connection>
                       <pool>
                           <dsName>java:XADerbyDS2</dsName>
                           
<icClass>org.jnp.interfaces.NamingContextFactory</icClass>
                           <url>localhost:1099</url>
                           <user>synapse</user>
                           <password>synapse</password>
                       </pool>
                   </connection>
                   <statement>
                       <sql>update company set price=? where name =?</sql>
                       <parameter expression="//m0:return/m0:last/child::text()"
                                  xmlns:m0="http://services.samples/xsd"; 
type="DOUBLE"/>
                       <parameter 
expression="//m0:return/m0:symbol/child::text()"
                                  xmlns:m0="http://services.samples/xsd"; 
type="VARCHAR"/>
                   </statement>
               </dbreport>

               <transaction action="commit" />
               <send/>
           </out>
       </sequence>


</definitions>



      was (Author: irantha):
    Tested with Jboss.
  
> Transaction mediator for synapse
> --------------------------------
>
>                 Key: SYNAPSE-480
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-480
>             Project: Synapse
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: FUTURE
>            Reporter: irantha suwandarathna
>             Fix For: FUTURE
>
>         Attachments: tx_mediator.patch
>
>
> New synapse mediator to manipulate JTA transactions. 
>  
> syanpse.xml configuration for new mediator:
> <transaction 
> action="new|use-existing-or-new|fault-if-no-tx|commit|rollback|suspend|resume"/>
>  
> Meaning of action attribute values are explained below:
> new : create a new jta transaction. generate a fault if a transaction already 
> exist.
> use-existing-or-new : create a new jta transaction. do nothing if a 
> transaction exist.
> fault-if-no-tx : generate a fault if no transaction exist.  do nothing if a 
> transaction exist.
> commit : commit transaction. generate a fault if no transaction exist.
> rollback: rollback transaction. generate a fault if no transaction exist.
> suspend: suspend transaction. generate a fault if no transaction exist.
> resume: resume transaction. generate a fault if no transaction exist.
>  
> There will be a new transaction configuration section in axis2.xml to define 
> UserTransaction (used to create a new transaction) and TransactionManager 
> (need for suspend and resume actions ) JNDI parameters.
> newly created usertransaction is assigned to axis2 message context property 
> named BaseConstants.USER_TRANSACTION and newly created transaction manager is 
> assigned to axis2 message context property named 
> BaseConstants.TRANSACTION_MANAGER
>  
> Same message context property is used by JMS transport when creating a new 
> usertransaction. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to