简体   繁体   English

Mule是否支持带有XA事务的MySQL数据库连接池?

[英]Does Mule support MySQL database connection pooling with XA transaction?

Does Mule support MySQL database connection pooling with XA transaction? Mule是否支持带有XA事务的MySQL数据库连接池? if yes could you please provide me the configuration? 如果可以,请提供给我配置吗?

Yes it does. 是的,它确实。 You can configure it using Spring bean configuration like below. 您可以使用如下所示的Spring bean配置对其进行配置。

<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 并在m子mysql连接器中引用上述bean定义

<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 供您参考, 这里是MySQL和JMS ActiveMQ之间XA事务的示例流程

Mule does support XA Transaction handling. Mule支持XA事务处理。 Here's a good example with configurations. 这是一个有关配置的好例子。

http://blogs.mulesoft.com/dev/mule-dev/how-to-work-with-jdbc-and-xa-transactions/ 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). 请记住,Mule支持事务处理,但真正的工作是Spring Beans(Java)的XML配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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