« Return to Thread: help with jdbc transaction

Re: help with jdbc transaction

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View in Thread

You have to use XADataSource for XA transactions.

Andrew

On 3/6/07, mario.sala <mario.mule@... > wrote:

how to use jdbc with transaction but without a aplication server ??

i use jotm like transaction manager
transaction-manager
factory="org.mule.extras.jotm.JotmTransactionManagerFactory"></transaction-manager>


my application context is correct?
<beans>
    <bean id="muleJdbcDatasource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="shutdown">
        <property name="driverClassName"
value=" net.sourceforge.jtds.jdbc.Driver" />
        <property name="url"
value="jdbc:jtds:sqlserver://localhost/EsbusMule" />
        <property name="username" value="sa" />
        <property name="password" value="123" />
    </bean>
</beans>

my mule descriptor is correct? im use
org.mule.transaction.XaTransactionFactory is that ok
<mule-descriptor name="TestJdbcUMO"
  implementation="org.mule.components.simple.BridgeComponent">
  <inbound-router>
    <endpoint address="stream://System.in">
    <properties>
      <property name="promptMessage" value="Please enter text...: " />
     </properties>
    </endpoint>
  </inbound-router>
  <outbound-router>
   <router className="org.mule.routing.outbound.MulticastingRouter">
    <endpoint address="jdbc://insertRecord" connector="jdbcConnector">
     <transaction action="ALWAYS_JOIN"
factory="org.mule.transaction.XaTransactionFactory"/>
    </endpoint>
    <endpoint address="jdbc://insertRecord2" connector="jdbcConnector">
     <transaction action="ALWAYS_JOIN"
factory="org.mule.transaction.XaTransactionFactory"/>
    </endpoint>
    <transaction action="ALWAYS_BEGIN"
factory="org.mule.transaction.XaTransactionFactory"/>
   </router>
  </outbound-router>
</mule-descriptor>
</mule-configuration>

my connector is:
<connector name="jdbcConnector"
  className="org.mule.providers.jdbc.JdbcConnector ">
  <properties>
   <container-property name="dataSource"
    reference="muleJdbcDatasource" required="true" />
   <map name="queries">
    <property name="insertRecord" value="INSERT into Testing (description)
VALUES (${pname},${payload})" />
    <property name="insertRecord2" value="INSERT into Testing2 (datasmall)
VALUES (${payload})" />
   </map>
  </properties>
</connector>

my problem is that with this configuration my messages do not transaction
and always execute commint, even though in insertRecord2 it happens an error

Thanks for its aid
--
View this message in context: http://www.nabble.com/help-with-jdbc-transaction-tf3356647.html#a9335676
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: help with jdbc transaction