Skip to content

Instantly share code, notes, and snippets.

@friek
Created June 12, 2014 08:36
Show Gist options
  • Select an option

  • Save friek/e90c1c82d4e8914cca53 to your computer and use it in GitHub Desktop.

Select an option

Save friek/e90c1c82d4e8914cca53 to your computer and use it in GitHub Desktop.
Wildfly MySQL XA configuration
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file needs to be placed in wildfly_dir/modules/system/layers/base/com/mysql/main.
The mysql connector needs to go there as well.
-->
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.25.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is a portion of the subsystem section of the wildfly configuration.
-->
<subsystem xmlns="urn:jboss:domain:datasources:2.0">
<datasources>
<xa-datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true">
<xa-datasource-property name="URL">jdbc:mysql://hostname:3306/dbname?characterEncoding=UTF-8</xa-datasource-property>
<driver>com.mysql</driver>
<security>
<user-name>mysql username</user-name>
<password>mysql password</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</xa-datasource>
<drivers>
<driver name="com.mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment