Question regarding XA transactions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Question regarding XA transactions

Giovanni Delloro
This post was updated on .
Hi,

We are using ActiveMQ with a MySQL database for persistent messages. To be able to support XA transactions, do I need to configure an XA datasource for the database in activemq.xml? I have searched the web quite extensively and this doesn't seem to be the case, but I haven't found a conclusive answer yet.

The reason I ask is the fact that we are currently upgrading ActiveMQ from v5.10.0 to v5.14.3.

Our v5.10.0 MySQL datasource configuration looked like this, mentioning an XA datasource:

  <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"/>
    <property name="url" value="jdbc:mysql://{host}:{port}/{database}?relaxAutoCommit=true"/>
    <property name="username" value="{user}"/>
    <property name="password" value="{password}"/>
    <property name="maxActive" value="20"/>
    <property name="defaultTransactionIsolation" value="2"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>

When using this configuration in v5.14.3 the broker won't start because MysqlXADataSource is not a jdbc Driver. So much I understand.

With v5.14.3 we now use the following database configuration:

  <bean id="mysql-ds" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url" value="jdbc:mysql://{host}:{port}/{database}?relaxAutoCommit=true"/>
    <property name="username" value="{user}"/>
    <property name="password" value="{password}"/>
    <property name="maxTotal" value="20"/>
    <property name="defaultTransactionIsolation" value="2"/>
    <property name="poolPreparedStatements" value="true"/> 
  </bean>

Does this configuration still allow for XA transaction support?
If not, how should I configure the mysql-ds?

Thanks in advance.