Does Mule support MySQL database connection pooling with XA transaction? if yes could you please provide me the configuration?
Does Mule support MySQL database connection pooling with XA transaction?
497 Views Asked by Gopi At
2
There are 2 best solutions below
1

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).