0 Replies Latest reply on Nov 2, 2011 4:11 AM by baecks

    XA datasource (with failover) in JBOSS AS 5.1

    baecks Newbie



      For a JEE app running on JBOSS AS 5.1, I've set up a XA datasource (using JTDS to connect to a MS SQL 2008 database). The *-ds.xml file is shown below. I've set up database redundancy (2 SQL server instances being mirrored). So I want the datasource to fail-over to the second database server if the first one fails. I got this working for the non-XA datasources. For this XA-datasource however I'm still not able to get it working, although I followed the documentation from JBOSS.org:

      - adding the <url-delimiter> tag: <url-delimiter>|</url-delimiter>

      - adding an URL property: <xa-datasource-property name="URL">|</xa-datasource-property>

      - adding the <url-property> tag: <url-propert>URL</url-property>

      - remove the <xa-datasource-property name="ServerName> tag.


      The only result is a non-working datasource and a server log entry saying that the JTDS driver doesn't support a property named "URL". I'd prefer to make this work with the jtds driver. However if the MS provided JDBC driver should be required, that's something that we could consider.


      All help to make this work is very appreciated.


      WsDatasource-ds.xml file (without the fail-over):



      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE datasources PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN" "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">






                          <xa-datasource-property name="ServerName"></xa-datasource-property>

                          <xa-datasource-property name="PortNumber">1433</xa-datasource-property>

                          <xa-datasource-property name="DatabaseName">videoscape41</xa-datasource-property>

                          <xa-datasource-property name="User">videoscape</xa-datasource-property>

                          <xa-datasource-property name="Password">v1d30scap3</xa-datasource-property>

                          <!--  uncomment following if SQL SERVER is being run as a named instance -->

                          <!--  <xa-datasource-property name="Instance">@db.instance@</xa-datasource-property> -->

                          <xa-datasource-property name="XaEmulation">true</xa-datasource-property>











                          <new-connection-sql>select 1</new-connection-sql>

                          <check-valid-connection-sql>select 1</check-valid-connection-sql>




                                    <type-mapping>MS SQLSERVER</type-mapping>