简体   繁体   中英

Does Mule support MySQL database connection pooling with XA transaction?

Does Mule support MySQL database connection pooling with XA transaction? if yes could you please provide me the configuration?

Yes it does. You can configure it using Spring bean configuration like below.

<spring:beans>
    <spring:bean id="mySqlXADataSource" name="MySqlXADataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource">
        <spring:property name="user" value="root" />
        <spring:property name="password" value="root" />
        <spring:property name="url" value="jdbc:mysql://localhost:3306/dev" />
    </spring:bean>
</spring:beans>

and refer the above bean definition in mule mysql connector like

<db:mysql-config name="MySQL_XA_Configuration" dataSource-ref="mySqlXADataSource" doc:name="MySQL Configuration" />

For your reference here is an example flow on XA transaction between MySQL and JMS ActiveMQ

Mule does support XA Transaction handling. Here's a good example with configurations.

http://blogs.mulesoft.com/dev/mule-dev/how-to-work-with-jdbc-and-xa-transactions/

Remember that Mule supports the transaction handling but the real work is the XML configuration of the Spring Beans (Java).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM