2 Replies Latest reply on Jun 21, 2007 3:07 PM by Stefan Lindner

    xa-tx-datasource not binding to jndi

    Chip Schoch Novice

      JBossAS 4.2.0.CR2. I changed my mssql-ds.xml from:

      <local-tx-datasource>
       <jndi-name>DefaultDS</jndi-name>
       <connection-url>jdbc:jtds:sqlserver://localhost:1433;SelectMethod=Cursor;DatabaseName=JBossMessaging</connection-url>
       <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
       <user-name>xxx</user-name>
       <password>xxx</password>
       <metadata><type-mapping>MS SQLSERVER2000</type-mapping></metadata>
       </local-tx-datasource>


      to:

      <xa-tx-datasource>
       <jndi-name>DefaultDS</jndi-name>
       <xa-datasource-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</xa-datasource-class>
       <connection-url>jdbc:jtds:sqlserver://localhost:1433;SelectMethod=Cursor;DatabaseName=JBossMessaging</connection-url>
       <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
       <user-name>xxx</user-name>
       <password>xxx</password>
       <metadata><type-mapping>MS SQLSERVER2000</type-mapping></metadata>
       </xa-tx-datasource>


      for the database that I have my JBM tables in and now the queues don't start because they are waiting on the dependent datasource. It seems that the datasource is not binding to jndi.

      Is there something else that needs to be changed to go from local to xa transactions?

        • 1. Re: xa-tx-datasource not binding to jndi
          Stefan Lindner Newbie

          I have the same problem (not wiht mssql) but with Ingres. did you find a solution?

          • 2. Re: xa-tx-datasource not binding to jndi
            Stefan Lindner Newbie

            Ah! I found the solution. First of all the datasurce is NOT a <xa-datasource>! It is a <xa-datasource>, this is a little bit confusing in JBoss documentation wiki.

            The attributes <connection-url> and <driver-class> are specific for the <local-tx-datasource> type. In a <xa-datasource> you must use

            <xa-datasource-class>com.ingres.jdbc.IngresXADataSource</xa-datasource-class>
            
             <xa-datasource-property name="PortNumber">26063</xa-datasource-property>
             <xa-datasource-property name="DatabaseName">visiomedic5</xa-datasource-property>
             <xa-datasource-property name="ServerName">192.168.222.222</xa-datasource-property>
            


            instead (Ingres example, use your own class and port and database name.